domain mapping not working after transferring to Nginx

Hi, my domain mapping for my subsites is not working anymore after transferring to an nginx dedicated server. I have already granted support access for you to take a look. I went to my domain registrar and made sure that my A-record correctly points to my IP address, the same ip address listed under the domain mapping settings tab. Please advise.

Thanks

  • zspri

    Hi Jude,
    Thanks for the reply. The domain mapping seems to be working now, however the permalinks have stopped working. I have had to resort to the default verbiage for pages and posts (e.g., mydomain.com/?page_id=755). According to my server admin, there are three nginx conf. files so I'm not sure which one you would like? Would you be able to get the info you need from the support access?

  • Jude

    Hi there zspri

    This looks like something wrong with your rewrite rules. Can you use the minimal stripped down version I have included below. You can of course add more once its working

    server {
            server_name example.com;
    
            root /var/www;
            index index.php;
    
            location / {
                    try_files $uri $uri/ /index.php?$args;
            }
    
            location ~ \.php$ {
    		include 	/etc/nginx/fastcgi_params;
    		fastcgi_pass  	127.0.0.1:9000;
    		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            }
    
    	location /phpmyadmin {
                   root /usr/share/;
                   index index.php index.html index.htm;
                   location ~ ^/phpmyadmin/(.+\.php)$ {
                           try_files $uri =404;
                           root /usr/share/;
                           fastcgi_pass 127.0.0.1:9000;
                           fastcgi_index index.php;
                           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                           include /etc/nginx/fastcgi_params;
                   }
                   location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                           root /usr/share/;
                   }
            }
            location /phpMyAdmin {
                   rewrite ^/* /phpmyadmin last;
            }
    
    }

    This is the default.conf file and remember to replace example.com with your site

    Also you can take a look at this ( dated but helpful )

    https://wordpress.org/plugins/nginx-compatibility/

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.