Vultr is using NGINX as its webserver. Fortunately, it’s very straightforward to include any custom NGINX rules.
Here’s how to configure the Vultr NGINX configuration file for our PDA Gold to work correctly on their hosting server.
Step 1: Copy the rewrite rules shown on Prevent Direct Access Gold Settings page
Step 2: Locate your server block configuration file
By default, it’s located at
/etc/nginx/nginx.conf
It’s also common for the config file to locate under an directive:
include /etc/nginx/conf.d/*.conf;
If you set up multiple sites, the config files can be found under:
/etc/nginx/site-available or /etc/nginx/site-enabled
Create a configuration file if it doesn’t exist yet, i.e. nginx.conf. Actually, any file ending with .conf will do.
Step 3: Put the copied rewrite rules inside the server block
server {
location / {
...
}
#Put our rewrite rules here, i.e.
rewrite wp-content/uploads(/_pda/.*\.\w+)$ "/index.php?pda_v3_pf=$1" last;
rewrite private/([a-zA-Z0-9-_]+)$ "/index.php?pda_v3_pf=$1&pdav3_rexypo=ymerexy" last;
}
If your WordPress installation is under a subdirectory, you should update the rules accordingly.
rewrite subdirectory/wp-content/uploads(/_pda/.*\.\w+)$ "/subdirectory/index.php?pda_v3_pf=$1" last; rewrite subdirectory/private/([a-zA-Z0-9-_]+)$ "/subdirectory/index.php?pda_v3_pf=$1&pdav3_rexypo=ymerexy" last;
Step 4: Restart your NGINX server by clicking the “Server Restart” icon.
Step 5: Go back to our PDA Gold settings page. Click on “Check rewrite rules” button.
That’s all you have to do. Now our file protection should be working correctly on your website hosted on Vultr.