Custom Nginx rules?

I’d like to include some custom nginx configs and rules. So far, I know that I need to include them in /var/www/

But, if some rules overlap, will they be overwritten? Which file has the highest priority?

I’d want to have some custom 301 redirects, how do I do that? my main domain is and I want to 301 custom (non-wordpress) pages:

Redirect to How do I do that?

Rules loaded earlier take precedence over rules loaded later.

If you want to ensure your rules will be evaluated first, you should ee site edit and move the last include to above the standard ones.

The redirect you want can be achieved by:

location ^/page3.html {
    return 301
1 Like

That nginx rule doesn’t really work in my setup. I have SSL enabled via EE and everything works fine. But, along with my WordPress, I have a simple, custom html page inside a directory.

When accessing that page, the http to https redirection works fine, but the www to non-www doesn’t.

When adding the rule you proposed, it still doesn’t work.

Any tips/pointers?

I’d like to redirect to

When I added your rule, I got a “too many redirects” error