Search for answers:
Customer Notices: WordPress 4.5 Affects LiveEditor Functionality - See this article WordFence Plugin Affects LiveEditor - See this article

Using Download Restrictions with NGINX

The OptimizeMember Download Restrictions will work with NGINX, as the access control relies almost entirely on PHP and not the web server. However, there are a few things to keep in mind if you're using NGINX with OptimizeMember Download Restrictions.

Preventing Access to /optimizeMember-files/

All files that you want to protect with OptimizeMember must reside in wp-content/plugins/optimizeMember-files/. OptimizeMember adds an .htaccess file to that directory to prevent public access. However, NGINX does not support .htaccess files. This means that you will need to update your NGINX server configuration to prevent public access to files in that directory.

What follows is an example of what you might add to your NGINX configuration, however we highly recommend contacting your web hosting company for assistance with making this change as each hosting environment is different.

location /wordpress/wp-content/plugins/optimizeMember-files {
        deny  all;
        return 403;
}

Basic Download Restrictions

Basic Download Restrictions (OptimizeMember → Download Options → Basic Download Restrictions) should work just fine with NGINX.

Using the [opmFile /] Shortcode

The [opmFile /] shortcode should work just fine with NGINX. No additional configuration is necessary.

Advanced Mod-Rewrite Linkage

This feature will not work with NGINX. Rewriting in OptimizeMember depends on using an .htaccess file, which means that rewriting will not work with NGINX.

Using the [opmStream /] Shortcode and JWPlayer

If you are self-hosting your video files (i.e., in wp-content/plugins/optimizeMember-files/), then you must set the shortcode attribute rewrite="no", to tell the [opmStream /] shortcode not to do any rewriting, as rewriting will not work with NGINX.

If you are using Amazon S3/CloudFront integration and hosting your video files with Amazon, you don't need to do anything special--the default [opmStream /] shortcode should work as expected.

Advanced Download Restrictions

Yes, Advanced Download Restrictions (OptimizeMember → Download Options → Advanced Download Restrictions) should work just fine with NGINX, as that functionality relies on PHP and is not dependent on the web server.

Remote Auth / Podcasting

Remote Authentication, most commonly used with podcasting (OptimizeMember → Download Options → Remote Auth / Podcasting), should work fine with NGINX. The remote auth headers are sent via PHP and not the web server, so the OptimizeMember implementation of this should work with NGINX.

Summary

To summarize, the main thing you need to be aware of when using Download Restrictions with OptimizeMember and NGINX is that you must protect the /optimizeMember-files/ directory inside your NGINX web server configuration. Once that has been done, the following points should be kept in mind.

The following should work fine with NGINX:

  • Basic Download Restrictions
  • Advanced Download Restrictions
  • Remote Auth / Podcasting
  • [opmFile /] Shortcode
  • [opmStream /] Shortcode w/ self-hosted files and rewrite="no" shortcode attribute
  • [opmStream /] Shortcode w/ Amazon S3/CloudFront

The following will not work with NGINX:

  • Advanced Mod-Rewrite Linkage
Didn't find an answer to your question? Contact Our Support Team (Submit a ticket)
Was this article helpful?
0 out of 0 found this helpful
Follow

Comments

Other Help Categories:

Get Started Guide

Watch our Ultimate Getting Started guide video

Pre-Sales Questions

Ask questions before purchasing our products

Login Problems

If you're having issues logging into our members hub

Accounts & Billing

Update your billing, request a refund and other accounts help

API Key Issues

Get help with licensing your site and API key issues

Membership Help

Get help creating Membership portals and courses

LiveEditor Help

If you need help using or troubleshooting the LiveEditor

Integrations

Find out about the many integrations possible with OptimizePress

Affiliate Questions

Have questions about promoting OptimizePress

Clubhouse Questions

Questions about our Clubhouse Membership Subscription