V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
skyroam
V2EX  ›  WordPress

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

  •  
  •   skyroam · 2020-03-08 09:21:00 +08:00 · 1625 次点击
    这是一个创建于 1745 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    1 条回复    2020-03-08 14:03:18 +08:00
    skyroam
        1
    skyroam  
    OP
       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;
    }

    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1155 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:38 · PVG 02:38 · LAX 10:38 · JFK 13:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.