NGINX Support

Prevent Direct Access Gold now supports Nginx, together with the most popular Apache server. Since Nginx does not have .htaccess-type capability, Prevent Direct Access Gold and WordPress at large cannot modify and update the server configuration automatically for you. You have to do it manually. Here’s how:

For Prevent Direct Access Gold version 3.0 and above

  1. Copy the rewrite rules shown on Prevent Direct Access Gold Settings page
  2. Find and open your website’s Nginx config file which is normally located at /etc/nginx/site-available (or /etc/nginx/conf/site-available if you’re using Arch Linux)
  3. Put it 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;
    }
  4. Restart your Nginx server. Our Prevent Direct Access Gold should be now working on your website.

For version 2.0 and below

Please use this rewrite rules instead:

server {
location / {
...
}
#Put our rewrite rules here, i.e.
rewrite wp-content/uploads/(.+)(\.)([A-Za-z0-9]+)$ "/index.php?pre_dir_acc_61co625547=$1&is_direct_access=true&file_type=$3" last;
rewrite private/([a-zA-Z0-9-_]+)$ "/index.php?pre_dir_acc_61co625547=$1&custom_181191=$2" last;
}

For those who use Flywheel hosting, please contact their support. They will translate our original .htaccess rewrite rules into Ngnix and implement it for you.

Please refer to the detailed configurations for WP Engine and Bitnami.

Lasted updated on July 6, 2018