标签 (空格分隔): PHP
Nginx 配置文件
- listen 80 default_server;
- #listen [::]:80 default_server ipv6only=on;
- server_name _;
- index index.html index.htm index.PHP;
- #root /home/wwwroot/default;
- root /home/wwwroot/web.Laravel.cn/public;
- location /nginx_status
- {
- stub_status on;
- access_log off;
- }
- location / {
- try_files $uri $uri/ /index.PHP?$query_string;
- }
- location ~ .*\.(gif|jpg|jpeg|PNG|bmp|swf)$
- {
- log_not_found off;
- access_log off;
- expires 30d;
- }
- location ~ .*\.(JS|CSS)?$
- {
- expires 12h;
- }
- location ~ /.well-known {
- allow all;
- }
- location ~ /\.
- {
- deny all;
- }
- access_log /home/wwwlogs/access.log;
注意点
1 根目录要写对 /home/wwwroot/Web.Laravel.cn/public 要指向你的项目入口文件
2 如果出现 除 / 根目录外 其他路由都不能访问
2.1 首先在配置文件添加
Laravel => https://laravel.com/docs/5.0/installation#pretty-urls
2.2 修改 fastcgi.conf
2.3 修改项目根目录下的. user.INI
修改如果无法写 请修改权限
chattr -i /home/wwwroot/Web.Laravel/public/.user.INI
VIM 打开
来源: http://www.bubuko.com/infodetail-2850155.html