如何解决使用nginx服务器+ php找不到特定文件夹的index.php 404文件
尝试授予对文件夹(不在 root 下)中的index.php的访问权限。 Nginx似乎无法在 eaophp 中找到 index.php 文件,而 index.html 都在 eao 和 eao2 。
这是我的Nginx配置文件:
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
root /var/www/html/moodle;
index index.php index.html index.htm;
server_name 192.168.10.115;
location / {
try_files $uri $uri/ =404;
}
location /eao {
alias /var/www/html/eao;
try_files $uri $uri/ =404;
}
location /eao2 {
alias /var/www/html/eao2;
try_files $uri $uri/ =404;
}
location /eaophp {
alias /var/www/html/eaophp;
try_files $uri $uri/ =404;
}
location /dataroot/ {
internal;
alias /var/www/html/moodledata/;
}
location ~ [^/]\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name 192.168.10.115;
return 302 https://$server_name;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。