Php Nginx无法访问网站的部分内容
Si我试图在nginx上运行Invision论坛,但由于某些原因,它似乎无法访问uploads文件夹。我的配置很可能是错误的,但我不太确定,因为这是我第一次使用nginx 这是我的配置文件:Php Nginx无法访问网站的部分内容,php,nginx,webserver,Php,Nginx,Webserver,Si我试图在nginx上运行Invision论坛,但由于某些原因,它似乎无法访问uploads文件夹。我的配置很可能是错误的,但我不太确定,因为这是我第一次使用nginx 这是我的配置文件: worker_processes 1; user www-data; events { worker_connections 1024; } http { include mime.types; default_type application/octet-
worker_processes 1;
user www-data;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 80;
listen [::]:80;
server_name localhost;
root /var/www/forums;
index index.php;
charset utf-8;
client_max_body_size 100M;
fastcgi_read_timeout 1800;
location / {
try_files $uri /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
你的截屏截图显示了错误,这些错误到底是什么?据我所知,还没有截图?这些都是我犯的错误。404,因为它无法访问资源@WesleySmithAh,抱歉,我没有看到水平滚动条。请尝试删除这行
try_files$uri=404代码>然后运行sudo systemctl reload nginx
?我不确定这是怎么回事,但我从来没有在我使用或使用的任何配置中看到过。另外,让我问一个明显的问题,你确定这些文件确实存在于被访问的路径上,并且它们的权限设置为运行nginx的用户可以读取它们,对吗?