【发布时间】:2017-06-26 15:58:58
【问题描述】:
我正在尝试在 nginx 上使用 Laravel 4.2。我有一个 VPS(Dreamhost),我将 Laravel 框架放在用户的根路径中(/home/vi360/),公共路径在/home/vi360/vide360.com.br
我一直在研究为 Laravel 设置 nginx 的几种方法,但没有取得任何成功。只有主页正在打开 (www.vide360.com.br),但所有其他页面(由 /home/vi360/app/routes.php 指导)都返回错误 404。
我创建了/home/vi360/nginx/vide360.com.br/vide360.conf,如下所示:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/vi360/vide360.com.br;
index index.php index.html index.htm;
server_name [server ip address];
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我可能做错了什么?
【问题讨论】: