求助, nginx 开启 https 下配置 xx.conf 路径问题
一下是 xx.conf 文件中的 location短
location / {
index index.html index.htm index.php default.html default.htm default.php forum.php;
#root /home/wwwroot/default/laravel/public;
try_files $uri $uri/ /index.php?$query_string;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
问题: root /home/wwwroot/default/laravel/public这一段被放开,会出现404的报错,访问不到 laravel/public里的index.php 但是可以访问到.html的文件
但是如果 root /home/wwwroot/default/laravel/public这一段被注释, nginx会自动访问到nginx/html目录。访问正常, index.php index.html均可访问
请问如何才能正常访问到 /home/wwwroot/default/laravel/public 里的php文件
放出 Laravel5.5 的 nginx 官方推荐配置,其中加上了 https 跳转的代码,但是 SSL 的其他配置,请自行添加。
Laravel 5.5 官方推荐 Nginx 配置学习