Why am I getting 404 not found on this wordpress subdomain on my Nginx server?

File structure /var/www/html/info

I have place a info.php in the folder location that echos php info, this is a 404.

Any guidance much appreciated.

        # 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;
            }
            
        }   


Leave a Comment