Request help with Nginx for WP Hide Plugin?

MyTester

Active member
Jul 18, 2019
169
57
28
I installed WP Hide Pro here from the Forum.

Plugin was unable to automatically re-enter code see notice I get in wp:

Unable to automatically save the rewrite rules, manual action required! Check Setup menu for instructions on how to deploy the rewrite rules on your server.

And asking for this manual configuration:

ReWrite

Add the following to your Nginx config file located usually at / etc / nginx / sites-available /

Replace any existing rewrite rules within # BEGIN WP Hide & Security Enhancer and # END WP Hide & Security Enhancer

The code can contain further instructions, those need followed. Read carefully the lines and make adjustments for any #REPLACE comment ..

After config file updated, Test the new data using nginx -t. If successfully compile, restart the Nginx service.

The following code need to be placed before location / block.

THE PROBLEM IS:

I can't find this way to do the configuration:

/ etc / nginx / sites-available /

I just found the way:

/ mysite / conf / nginx and in there the ssl.conf file

I don't know if I should put code inside the ssl.conf file.
 

clairvoyant

Active member
Trusted Uploader
Jul 30, 2018
217
175
43
Indonesia
Did you have the root access of the server? If not, please contact your server provider. You need to access / etc / nginx / sites-available / directory
 
  • Like
Reactions: ckeeper

MyTester

Active member
Jul 18, 2019
169
57
28
Did you have the root access of the server? If not, please contact your server provider. You need to access / etc / nginx / sites-available / directory

Tu é brasileiro irmão... Yes I have access but this path does not seem to exist on my server.
 

clairvoyant

Active member
Trusted Uploader
Jul 30, 2018
217
175
43
Indonesia
Tu é brasileiro irmão... Yes I have access but this path does not seem to exist on my server.

You said you only have access to / mysite / conf / nginx . Means that you not really have access to the root level. You only have a limited access to your account only.
 

MyTester

Active member
Jul 18, 2019
169
57
28
You said you only have access to / mysite / conf / nginx . Means that you not really have access to the root level. You only have a limited access to your account only.

I have access to Listing directory /

I have this access:

image.png

a1.png

But I don't know how to make this change or if there is another alternative for my nginx configuration.
 
  • Like
Reactions: gugel69

clairvoyant

Active member
Trusted Uploader
Jul 30, 2018
217
175
43
Indonesia
I have access to Listing directory /

I have this access:

image.png

a1.png

But I don't know how to make this change or if there is another alternative for my nginx configuration.

Looks like its only account-level access. Is it your own server or you subscribe from some hosting?
 

ckeeper

Well-known member
Nov 8, 2019
623
376
63
I have access to Listing directory /

I have this access:

image.png

a1.png

But I don't know how to make this change or if there is another alternative for my nginx configuration.
What you have is a wordops installation. Do you have access to https://site.tld:22222 If you can get in to the admin panel there is an option called File Manager on the right side menu, default password id admin, password is admin unless it is changed, you should be able to access the files you need if you can login there. Best way to do these stuff you will need root access using ssh to your box if you have the rights though. If you donot have any of the above access ask the administrator kindly to do the changes for you.
 

MyTester

Active member
Jul 18, 2019
169
57
28
What you have is a wordops installation. Do you have access to https://site.tld:22222 If you can get in to the admin panel there is an option called File Manager on the right side menu, default password id admin, password is admin unless it is changed, you should be able to access the files you need if you can login there. Best way to do these stuff you will need root access using ssh to your box if you have the rights though. If you donot have any of the above access ask the administrator kindly to do the changes for you.

Yes, I'm not sure but I think it's wordops installation.

It is an installation through Vult'r integration with Agius Cloud.


So I have access to the file manager and the images above I got there.

And I also have super admin access via ssh

sudo su

I understand little SSH via Debian Server

But I don't know if they understand but this path that the plugin asks for my nginx configuration doesn't have it.

I even created a file / sites-available / and put code inside it.

on the way / my site / conf / nginx / sites-available /

Then restarting nginx and going back to wordprass and clearing the cache.

At first it seems that the plugin accepts the settings and the warning disappears.

But when trying to change and save something inside the plugin it returns the warning asking for manual modification.

I have access but I don't know exactly where to apply the modification.
 

MyTester

Active member
Jul 18, 2019
169
57
28
I contacted WP Hide Team

They told me this:

The paths can be different on your server, it just depends on the software you run. The / etc / nginx / site-available / is a generic path that usually can be found on Ubuntu systems.

============================

So it means that the path to my installation is not exactly this one, but another for this reason that I cannot find it.
 

ckeeper

Well-known member
Nov 8, 2019
623
376
63
Type this after you login to your server as root via ssh
Code:
nginx -t
This will show you the location of your nginx.conf file sites-available and sites-enabled are usually in the same directory.
 
  • Like
Reactions: MyTester

MyTester

Active member
Jul 18, 2019
169
57
28
Type this after you login to your server as root via ssh
Code:
nginx -t
This will show you the location of your nginx.conf file sites-available and sites-enabled are usually in the same directory.

image(1).png
 

BlackHatPro

New member
Jan 11, 2020
10
4
3
Could you explain your setup?

This is how it worked for me:

Create new a file in the conf folder: E.g vhost.conf

Add the following code:

Code:
include upstream.conf; #maybe not needed in your case

server {
    listen       80 default_server;
    server_name  default;



    root /var/www/html;


    # BEGIN WP Hide & Security Enhancer
           rewrite ^/d122189a8eff0bf18959557967a818a1/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;
    # END WP Hide & Security Enhancer
    # BEGIN WP Hide & Security Enhancer
             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;
             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;
             rewrite ^/inc/(.+) /wp-includes/$1 last;
             rewrite ^/data/(.+) /wp-content/$1 last;
             rewrite ^/cpadmin/$ /wp-admin/index.php last;
             rewrite ^/cpadmin(.*) /wp-admin$1 last;
    # END WP Hide & Security Enhancer


    include preset.conf; #maybe not needed in your case



    include defaults.conf; #maybe not needed in your case

}

And try it again with nginx -t

For the other warning, you received in the terminal:

The code line 2 of ssl.conf is deprecated... you need to change the code to the example above:

Try this:

edit your listen statement from:
listen 443;

to

listen 443 ssl;

and comment out or delete :
# ssl on;

then check nginx -t again.

 
Last edited:
  • Like
Reactions: MyTester

ckeeper

Well-known member
Nov 8, 2019
623
376
63
This is telling you your nginx files are under /etc/nginx, but also some more customized files are being used under /var/www/site..com/conf/nginx used by wordopsinstallation so if you want to add any customized configfile do not touch the ones under /etc/nginx since these could be updated with wo update commands and you will loose all your modifications, instead create a new config file wphide.conf under /var/www/site.com/conf/nginx/wphide.conf and place the code updates there. One fair warning your root folder is /var/www/site.com/htdocs
not root /var/www/html; make sure that is updated.
That is it easy peasy.
 
  • Like
Reactions: MyTester

MyTester

Active member
Jul 18, 2019
169
57
28
Could you explain your setup?

This is how it worked for me:

Create new a file in the conf folder: E.g vhost.conf

Add the following code:

Code:
include upstream.conf; #maybe not needed in your case

server {
    listen       80 default_server;
    server_name  default;



    root /var/www/html;


    # BEGIN WP Hide & Security Enhancer
           rewrite ^/d122189a8eff0bf18959557967a818a1/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;
    # END WP Hide & Security Enhancer
    # BEGIN WP Hide & Security Enhancer
             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;
             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;
             rewrite ^/inc/(.+) /wp-includes/$1 last;
             rewrite ^/data/(.+) /wp-content/$1 last;
             rewrite ^/cpadmin/$ /wp-admin/index.php last;
             rewrite ^/cpadmin(.*) /wp-admin$1 last;
    # END WP Hide & Security Enhancer


    include preset.conf; #maybe not needed in your case



    include defaults.conf; #maybe not needed in your case

}

And try it again with nginx -t

For the other warning, you received in the terminal:

The code line 2 of ssl.conf is deprecated... you need to change the code to the example above:

Try this:

edit your listen statement from:
listen 443;

to

listen 443 ssl;

and comment out or delete :
# ssl on;

then check nginx -t again.


Heartfelt thanks for helping me also with the SSL warning 🙏
 

MyTester

Active member
Jul 18, 2019
169
57
28
Could you explain your setup?

This is how it worked for me:

Create new a file in the conf folder: E.g vhost.conf

Add the following code:

Code:
include upstream.conf; #maybe not needed in your case

server {
    listen       80 default_server;
    server_name  default;



    root /var/www/html;


    # BEGIN WP Hide & Security Enhancer
           rewrite ^/d122189a8eff0bf18959557967a818a1/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;
    # END WP Hide & Security Enhancer
    # BEGIN WP Hide & Security Enhancer
             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;
             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;
             rewrite ^/inc/(.+) /wp-includes/$1 last;
             rewrite ^/data/(.+) /wp-content/$1 last;
             rewrite ^/cpadmin/$ /wp-admin/index.php last;
             rewrite ^/cpadmin(.*) /wp-admin$1 last;
    # END WP Hide & Security Enhancer


    include preset.conf; #maybe not needed in your case



    include defaults.conf; #maybe not needed in your case

}

And try it again with nginx -t

For the other warning, you received in the terminal:

The code line 2 of ssl.conf is deprecated... you need to change the code to the example above:

Try this:

edit your listen statement from:
listen 443;

to

listen 443 ssl;

and comment out or delete :
# ssl on;

then check nginx -t again.

This is telling you your nginx files are under /etc/nginx, but also some more customized files are being used under /var/www/site..com/conf/nginx used by wordopsinstallation so if you want to add any customized configfile do not touch the ones under /etc/nginx since these could be updated with wo update commands and you will loose all your modifications, instead create a new config file wphide.conf under /var/www/site.com/conf/nginx/wphide.conf and place the code updates there. One fair warning your root folder is /var/www/site.com/htdocs
not root /var/www/html; make sure that is updated.
That is it easy peasy.

@mocrobot on code with additional header and footer didn't work for me.

With additional codes it didn't work even changing the root path and removing the ones that aren't needed.

And doing exactly what I said without extra codes the way I said happens exactly what I say below

And @ckeeper what you said is exactly what you’ve already done.

I'll explain what happens when I do exactly the configuration you informed above:

I create a new wphide.conf configuration file at /var/www/site.com/conf/nginx/wphide.conf and place the code updates there.

After making the modification I apply the command:

nginx -t

And result is this apparently all ok

nginx-t.png

Then I go and restart nginx and go back to worprass and there I first clear the cache.

Then I click the plug button in CONFIRM to confirm the changes

Ai plugin and throw out the Wordprass panel I access the wordprass panel again and I see that:

At first it seems that the plugin accepts the settings and this warning below is gone.

aviso1.png
aviso.png
Code:
# BEGIN WP Hide & Security Enhancer

           rewrite ^/d34447897234jkd5587hjh8798kjjk92/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;

    # END WP Hide & Security Enhancer

    # BEGIN WP Hide & Security Enhancer

             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;

             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;

             rewrite ^/inc/(.+) /wp-includes/$1 last;

             rewrite ^/data/(.+) /wp-content/$1 last;

             rewrite ^/cpadmin/$ /wp-admin/index.php last;

             rewrite ^/cpadmin(.*) /wp-admin$1 last;

    # END WP Hide & Security Enhancer

But when changing and saving something in the plugin he again asks for manual modification and returns to show the warning in the image above.

So I don't know what else to do ... And I'm back to square one ... I'm almost giving up.

I was already forgetting to say: Thank you very much ... You are incredible ... God bless you!
 
Last edited:

MyTester

Active member
Jul 18, 2019
169
57
28
Could you explain your setup?

This is how it worked for me:

Create new a file in the conf folder: E.g vhost.conf

Add the following code:

Code:
include upstream.conf; #maybe not needed in your case

server {
    listen       80 default_server;
    server_name  default;



    root /var/www/html;


    # BEGIN WP Hide & Security Enhancer
           rewrite ^/d122189a8eff0bf18959557967a818a1/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;
    # END WP Hide & Security Enhancer
    # BEGIN WP Hide & Security Enhancer
             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;
             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;
             rewrite ^/inc/(.+) /wp-includes/$1 last;
             rewrite ^/data/(.+) /wp-content/$1 last;
             rewrite ^/cpadmin/$ /wp-admin/index.php last;
             rewrite ^/cpadmin(.*) /wp-admin$1 last;
    # END WP Hide & Security Enhancer


    include preset.conf; #maybe not needed in your case



    include defaults.conf; #maybe not needed in your case

}

And try it again with nginx -t

For the other warning, you received in the terminal:

The code line 2 of ssl.conf is deprecated... you need to change the code to the example above:

Try this:

edit your listen statement from:
listen 443;

to

listen 443 ssl;

and comment out or delete :
# ssl on;

then check nginx -t again.


My configuration

### WordPress Environment ###

WC Version: 3.9.3
REST API Version: ✔ 1.0.7
Log Directory Writable: ✔
WP Version: 5.3.2
WP Multisite: –
WP Memory Limit: 1 GB
WP Debug Mode: ✔
WP Cron: ✔
External object cache: –

### Server Environment ###

Server Info: nginx/1.16.1
PHP Version: 7.3.14-5+0~20200202.52+debian9~1.gbpa71879
PHP Post Max Size: 100 MB
PHP Time Limit: 30
PHP Max Input Vars: 5000
cURL Version: 7.52.1
OpenSSL/1.0.2u

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.3.16-MariaDB-1:10.3.16+maria~stretch
Max Upload Size: 100 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 3.9.3

### Security ###

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

### Dropin Plugins (1) ###

advanced-cache.php: advanced-cache.php

### Must Use Plugins (1) ###

wp-hide-loader.php: por –

Connected to WooCommerce.com: ✔

### Theme ###

Name: Flatsome Child
Version: 3.0
Author URL:
Child Theme: ✔
Parent Theme Name: Flatsome
Parent Theme Version: 3.10.4
Parent Theme Author URL: http://www.uxthemes.com/
WooCommerce Support: ✔
 

MyTester

Active member
Jul 18, 2019
169
57
28
There you go step by step what needs to be done for nginx, and even a video showing how to do it.
It's not that simple for me.

For Vultr's host the path seems to be different.

I won't be trying anything else that I won't be able to ... I give up using this plugin.

Thank you for real. From the heart God bless you thanks for all the help.
 

BlackHatPro

New member
Jan 11, 2020
10
4
3
@mocrobot on code with additional header and footer didn't work for me.

With additional codes it didn't work even changing the root path and removing the ones that aren't needed.

And doing exactly what I said without extra codes the way I said happens exactly what I say below

And @ckeeper what you said is exactly what you’ve already done.

I'll explain what happens when I do exactly the configuration you informed above:

I create a new wphide.conf configuration file at /var/www/site.com/conf/nginx/wphide.conf and place the code updates there.

After making the modification I apply the command:

nginx -t

And result is this apparently all ok

nginx-t.png

Then I go and restart nginx and go back to worprass and there I first clear the cache.

Then I click the plug button in CONFIRM to confirm the changes

Ai plugin and throw out the Wordprass panel I access the wordprass panel again and I see that:

At first it seems that the plugin accepts the settings and this warning below is gone.

aviso1.png
aviso.png
Code:
# BEGIN WP Hide & Security Enhancer

           rewrite ^/d34447897234jkd5587hjh8798kjjk92/rewrite_test /wp-content/plugins/wp-hide-security-enhancer-pro/include/rewrite-confirm.php last;

    # END WP Hide & Security Enhancer

    # BEGIN WP Hide & Security Enhancer

             rewrite ^/template/style.css /wp-content/plugins/wp-hide-security-enhancer-pro/router/file-process.php?action=style-clean&file_path=/wp-content/themes/dooplay/style.css&blog_id=1 last;

             rewrite ^/template/(.+) /wp-content/themes/dooplay/$1 last;

             rewrite ^/inc/(.+) /wp-includes/$1 last;

             rewrite ^/data/(.+) /wp-content/$1 last;

             rewrite ^/cpadmin/$ /wp-admin/index.php last;

             rewrite ^/cpadmin(.*) /wp-admin$1 last;

    # END WP Hide & Security Enhancer

But when changing and saving something in the plugin he again asks for manual modification and returns to show the warning in the image above.

So I don't know what else to do ... And I'm back to square one ... I'm almost giving up.

I was already forgetting to say: Thank you very much ... You are incredible ... God bless you!


I had the same issue, as it didn't have the right permission to save those settings.
So the code I just placed was just an example and shouldn't copy 1 on 1 as wp-wide code isn't the same.

Maybe you have overlooked something, try this.

Also,, could you place your Nginx code (from /etc/nginxnginx.conf) here:

after using nginx -t (this is only to see if you have errors in your nginx file)

(this code is to update your nginx file):
sudo systemctl reload nginx.service
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu