显然我不是唯一一个遇到这个问题的人,但是在尝试了针对情侣的每一个建议解决方案之后,我发现我不知道该怎么办。
我正在运行 Ubuntu 16.04、NGinx 和 PHP-FPM。
nginx.conf 是默认的,我只设置了一种信息更丰富的日志格式。
用户权限似乎没问题:NGinx 和 PHP_FPM 在用户 www-data 下运行。文档根所有者是 www-data。FPM-Pool 所有者是 www-data。套接字文件存在并且可写。
我已经尝试将文件夹和文件权限设置为最弱(chmod 777):没有结果。
这是我的 server.conf,正如您从注释行中看到的那样,我尝试了很多技巧 - 但没有效果:
server {
listen 8080;
# listen 8080 default_server;
# listen [::]:8080 default_server;
server_name example.com www.example.com
root /var/www/nginx/;
index index.php;
access_log /var/log/nginx/scripts.log scripts;
gzip on;
gzip_comp_level 3;
gzip_types text/plain text/css application/javascript image/*;
location ~ \.php$ {
if ($uri !~ "^/uploads/") {
fastcgi_pass unix:/run/php/php-fpm-www.sock;
}
include fastcgi.conf;
# include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
} …
Run Code Online (Sandbox Code Playgroud)