首页 > 解决方案 > Nginx 无法访问部分网站

问题描述

我正在尝试在 nginx 上运行 Invision 论坛,但由于某种原因它似乎无法访问上传文件夹。很可能是我的配置有问题,但我不太确定,因为这是我第一次使用 nginx。

在此处输入图像描述

这是我的配置文件:

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;
    }
    
}

}

标签: phpnginxwebserver

解决方案


推荐阅读