使用 nginx 将 wordpress 多站点迁移到 ubuntu - 未找到资源

使用 nginx 将 wordpress 多站点迁移到 ubuntu - 未找到资源

我最近将我的 wordpress 多站点安装从共享主机移到了运行 ubuntu 的云 SSD 服务器,我还将其更改为使用 nginx 运行。

一切都运行良好,只是少数资源似乎无法加载。我有一个来自 wpmu-dev 的插件内的结帐功能(该插件名为 pro-sites,允许用户付费注册博客)。当我转到结帐页面时,仅来自此插件的所有资源都返回 404 错误 - 但是,当我跟踪返回错误的文件的路径时,我可以在我的 SFTP 客户端中找到它们,它们位于它们应该在的位置。奇怪的是,在我的页面上,我有来自同一插件目录的其他资源,它们加载正常。

值得一提的是,当我迁移网站时,我将网址从 www.example.com 更改为 example.com - 但我看不出这会对此产生什么影响。我还有一个 SSL 证书,结帐页面上强制使用 https。

这是我的 nginx conf 文件:

server {
listen 80;
listen 443 ssl;
server_name skizzar.com *.skizzar.com;

ssl_certificate /etc/ssl/skizzar/www.skizzar.com.chained.crt;
ssl_certificate_key /etc/ssl/skizzar/www.skizzar.com.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;

root /usr/share/nginx/skizzar;
index index.php index.html index.htm;

add_header Access-Control-Allow-Origin *;

location / {
    try_files $uri $uri/ /index.php?$args ;
    rewrite files/(.+) /wp-includes/ms-files.php?file=$1 last;
}

location /nothingtosee {
    auth_basic "Admin Login";
    auth_basic_user_file /etc/nginx/pma_pass;
}

location ~ /favicon.ico {
    access_log off;
    log_not_found off;
}

location ~ \.php$ {
    try_files $uri /index.php;
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}
access_log  /var/log/nginx/$host-access.log;
error_log   /var/log/nginx/wpms-error.log;
}

这是我最近遇到的错误 - 显然它们是由于 /usr/share/nginx/skizzar/prosite 中缺少文件而导致的 - 但是,我不确定这里是否曾经存在过这样的文件

2016/01/07 11:08:58 [error] 21614#0: *116 open() "/usr/share/nginx/skizzar/pro-site" failed (2: No such file or directory), client: 81.158.229.186, server: skizzar.com, request: $
2016/01/07 11:09:07 [error] 21614#0: *116 "/usr/share/nginx/skizzar/pro-site/index.php" is not found (2: No such file or directory), client: 81.158.229.186, server: skizzar.com, $
2016/01/07 11:09:52 [error] 21614#0: *116 "/usr/share/nginx/skizzar/pro-site/index.php" is not found (2: No such file or directory), client: 81.158.229.186, server: skizzar.com, $

由于我没有主意,所以任何帮助或建议都会非常有用

更新:刚刚意识到 /pro-site 是结帐页面,因此它不应该在那里寻找目录

相关内容