【问题标题】:Why am I getting 404 not found on this wordpress subdomain on my Nginx server?为什么在我的 Nginx 服务器上的这个 wordpress 子域上找不到 404?
【发布时间】:2021-02-10 01:04:18
【问题描述】:

文件结构 /var/www/html/info

我在文件夹位置放置了一个 info.php 来回显 php 信息,这是一个 404。

非常感谢任何指导。

        # The sub directory used for the wordpress installation
        location /info {
            # Sets /var/www/html/info as root of /info
            #root  /var/www/html/info;

            #
            try_files $uri $uri/ /index.php;


            # Try the uri has sent by the browser, then the uri as a folder
            location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
                if (!-f $document_root$fastcgi_script_name){
                    return 404;
                }   

                #Look for the FastCGI Process Manager at this location
                fastcgi_pass unix:/run/php/php7.4-fpm.sock; 
                       
                #Include the nginx fastcgi default params
                include fastcgi_params;
            }
            
        }   


【问题讨论】:

    标签: php wordpress nginx


    【解决方案1】:

    您尝试使用 .htaccess 进行修复。或许能帮到你

    【讨论】:

    • 这是 Nginx 而不是 Apache。
    猜你喜欢
    • 2019-03-06
    • 2023-04-08
    • 1970-01-01
    • 2012-01-12
    • 1970-01-01
    • 2014-05-10
    • 2018-09-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多