php - 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;
}
}
}
解决方案
推荐阅读
- java - 为什么 Java 不接受泛型隐含的返回类型?
- swift - 使用 UISlider 的起始值问题
- azure-devops - Azure 管道从包装管道运行两个或多个独立管道?
- c - sem_post 是否唤醒了一个随机进程
- vb.net - vb.net DataGridView 仅在选定单元格中进行循环编号
- android - 如果 apk 仅使用 v2 签名方案进行签名,则获取证书指纹
- javascript - 将错误消息分配给 req.session.error 的目的是什么?
- angular - NGRX 效果抛出错误类型 XXXX 不可分配给类型 'ObservableInput
' - node.js - 将 Reactjs 连接到 Myqtthub
- python - Scrapy 无法抓取下一页