dongzheng4556 2018-12-05 17:01
浏览 62

在Forge上安装Wordpress的子目录

Attempting to install wordpress on a sub directory for a site hosted on AWS through forge. I have a server with the wordpress installed on 'learning-center' the other site is installed on 'rootdomain.us'.

-forge

--learning-center

---public

--rootdomain.us

---laravel-app

I've edited the nginx config in rootdomain.us to point to the public folder for the learning-center wordpress install as follows:

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/rootdomain.us/before/*;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name rootdomain.us;
    root /home/forge/rootdomain.us/public;

    # FORGE SSL (DO NOT REMOVE!)
    ssl_certificate /etc/nginx/ssl/rootdomain.us/394250/server.crt;
    ssl_certificate_key /etc/nginx/ssl/rootdomain.us/394250/server.key;

    ssl_protocols TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

    # FORGE CONFIG (DO NOT REMOVE!)
    include forge-conf/rootdomain.us/server/*;

    location /learning-center {

        alias /home/forge/learning-center/public;

        try_files $uri $uri/ /index.php?$query_string;
        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
        }

    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/rootdomain.us-error-custom.log error;

    error_page 404 /index.php;

    location ~ \.php$ {

        try_files $uri $uri/ @learning-center;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/rootdomain.us/after/*;

Which is the closest I've gotten it to working. Only issue is, instead of running the PHP file, it just downloads it when I reach the URL. Is there an easier way to do this? I'm open to any suggestions. So I've discovered with most recent updates, possibly previous ones, that if I go to the wp-admin url it functions appropriately. But still the root to the blog does not work.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作