wp-admin 目录上的 nginx 404

wp-admin 目录上的 nginx 404

访问 /wp-admin/ 文件夹时出现 404。知道原因吗?

这是配置文件 -

upstream domain_http {
    server 192.168.1.2:80;
}
server {

    listen 192.168.1.3:80;
    server_name domain.com;

            location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css|mp3|swf|ico|flv|woff)$
            {

                    access_log      /var/log/nginx/domain.com-static.log        rt_cache;
                    proxy_set_header Host $http_host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header       X-Forwarded-For $remote_addr;
                    expires +7d;
                    gzip_vary on;
                    gzip on;
                    add_header Cache-control public;
                    proxy_pass http://domain_http;
                    proxy_cache STATIC;
                            proxy_cache_valid 200 3d;
                    proxy_cache_use_stale   error timeout invalid_header updating
                                            http_500 http_502 http_503 http_504;
            proxy_cache_bypass $http_x_update; }

    location / {
                   access_log      /var/log/nginx/domain.com-pages.log        rt_cache;
                    proxy_set_header Host $http_host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header       X-Forwarded-For $remote_addr;
                    expires 15m;
                    add_header Cache-control public;
                    proxy_pass http://domain_http;
                    #proxy_cache_bypass on;
                    proxy_cache STATIC;
                            proxy_cache_valid 200 15m;
                    proxy_cache_use_stale   error timeout invalid_header updating
                                            http_500 http_502 http_503 http_504;
    proxy_cache_bypass $http_x_update; }

    location /wp-admin/ {

                     access_log      /var/log/nginx/domain.com-wp-admin.log        rt_cache;
                    proxy_set_header Host $http_host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header       X-Forwarded-For $remote_addr;
                    proxy_cache_bypass on; }
}

找到答案了!

添加proxy_pass http://domain_http;到 /wp-admin/ 部分解决了该问题。

答案1

发现问题,proxy_pass/wp-admin/ 文件夹中缺少内容。

添加proxy_pass http://domain_http;到 /wp-admin/ 部分解决了该问题。

相关内容