这是我的 nginx 配置,但是打开之后显示 502 Bad Gateway 错误,我也不知道是否还需要配置 php-pfm 和 bookstack
```nginx
server
{
listen 80;
#listen [::]:80;
server_name
book.xxxxxx.xxx ;
index index.php index.html index.htm default.php default.htm default.html;
root /home/www/BookStack/public;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php-pathinfo.conf;
location /
{
proxy_pass http://localhost:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE_HOST $remote_addr;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.(php|css|rss|jsp|cgi|asp|aspx|flv|xml|gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://localhost:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE_HOST $remote_addr;
}
}
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name book.xxxxxx.xxxx ;
index index.php index.html index.htm default.php default.htm default.html;
root /home/www/BookStack/public;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php-pathinfo.conf;
location /
{
proxy_pass http://localhost:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE_HOST $remote_addr;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.(php|css|rss|jsp|cgi|asp|aspx|flv|xml|gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://localhost:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE_HOST $remote_addr;
}
location ~ /.well-known {
allow all;
}
location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README)
{
deny all;
}
access_log /home/www/logs/bookstack_access.log;
error_log /home/www/logs/bookstack_error.log;
}
```