Question

WordPress site breaks when rewrite rules written in ngnix.conf file

Posted April 14, 2021 211 views
NginxServer OptimizationWordPressConfiguration ManagementInitial Server SetupUbuntu 20.04

Hi there,

I have setup a wordpress site on my nginx server running on ubuntu 20.04. Recently I installed a plugin called WP hide Pro (https://www.wp-hide.com/wp-hide-pro-now-available/) to hide the directories from listening and being visible on the page source code as well as circumvent CMS detection sites, for security purposes.

however upon setting up the rewrite rules and including them in the nginx.conf file, my site breaks completely, CSS customization on the site aren’t visible and it pretty much looks like a basic HTML static webpage.

I’m completely new to nginx to I would appreciate anyone helping me out.

Also the link to viewing my nginx configuration file is - https://pastebin.com/k7yhFp9w
backup link - https://wtools.io/paste-code/b4A2

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @z5251835,

To be honest from looking at your confiugration file and the rewrite rules that have been added, all seems okay. Having said that, the issue the way you are describing it, it doesn’t sound like an issue with Nginx but rather a misconfiguration.

What I mean is that Nginx is working and it’s doing what it’s been told. Having said that, what’s been told, to rewrite all those requests is interfering with the normal work of your website.

What I want to say is, since this is an issue created by the plugin itslelf, the best thing you can do is, is search this Plugin’s forums if there are any and if there aren’t contact the creator of the plugin directly.

I would be glad to hear the solution though! If you do manage to find it on your own or another user posts it here, or the developer gets back to you. Please do update this thread as I want to see how it unfolds!

Regards,
KFSys

  • Hey KFSys,

    Thanks for responding, I’ll keep the post updated. Please keep posting if you stumble across any possible solution.

    Regards,
    z5251835