首页 > 解决方案 > 我无法访问 wp-admin。我正在使用 NGINX Ubuntu

问题描述

我的网站可以访问,只是wp-admin部分不能这样打开 这个网站无法访问

这是我的代码

server {
    listen 80;
    root /home/nicho/projects/strongbee-web-3.0;
    index index.php index.html index.htm index.nginx-debian.html;
    server_name _;

    location ~* \.(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|wml|swf|ttf|ttc|otf|eot|woff|woff2)$ {
        expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    location / {
        #file ($uri) or directory ($uri/)? if not, redirect to /index.php + query string
        try_files $uri $uri/ /index.php?$args;
        index  index.html index.htm index.php;
    }

    location /wp-admin {
        index index.php;
    }

    rewrite /wp-admin$ $scheme://$host$uri/ permanent;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }
}

谁能帮我?

标签: wordpressnginx

解决方案


推荐阅读