怎么在 LNMP 环境下把 wordpress 和 bookstack 结合?

2020-03-08 09:21:00 +08:00
 skyroam

之前在 VPS 主机上用 LNMP 一键安装包搭建了环境,然后安装了 wordpress,现在想在添加一个 bookstack,主页放在 wordpress 的二级目录 book.admin.com ,但是我在网上看了好多教程也没明白怎么配置 nginx 和 php-pfm,求教有谁懂吗?

1597 次点击
所在节点    WordPress
1 条回复
skyroam
2020-03-08 14:03:18 +08:00
这是我的 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;
}

```

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/650839

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX