How To: Enhance Your Sites with Custom NGINX Configuration

How To: Enhance Your Sites with Custom NGINX Configuration

Please note that this is an advanced feature and we recommend that you are confident with NGINX before adding custom configuration.

The Nimbus platform streamlines web server configurations, handling everything centrally upon site creation.

Custom NGINX configuration allows you to manually add headers, create password-protected paths, customise redirects, configure error codes, optimise performance and more.

NGINX can also be used to secure your site(s) - has various features that can protect your site against common attacks such as DDoS. You can block certain types of traffic and limit the number of requests that can be made to your site.

If you have specific requirements, custom NGINX can help you achieve this.

Steps

1. Navigate to https://app.nimbushosting.co.uk/websites

2. Click the website you want to add custom NGINX configuration to

3. From the navigation bar click "Advanced"

4. Click "Configure NGINX"

5. Insert your custom configuration into the textbox

6. Click "Update NGINX"

If the NGINX update fails, it's likely due to a syntax error in the custom configuration. We recommend reviewing the config and resolving syntax errors.

Here are some examples of custom NGINX config you may wish to add to your website:

Allow access to a hidden folder

location ^~ /path/to/hidden/.folder {

allow all;

}

Password protect a specific directory

location /path/to/folder/ {

auth_basic “Password Protected Directory”;

auth_basic_user_file /home/storm/sites/sitename-com/.htpasswd;

}

List of allowed directives;

location ("/" not allowed)return
rewriteproxy_pass
aliaslimit_except
fastcgi_passuwsgi_pass
scgi_passtry_files
iferror_page
add_headerexpires
setauth_basic
allow/denyallow_methods
satisfyinternal
open_file_cacheContent Security Policy
limit_ratevalid_referers
map

Looking for something else?

Check out these useful links to our website and other carefully curated resources:

Support Hub homepage

Upgrade your package

Industry-leading insight reports

Insightful webinar replays

Expertly crafted e-book business guides

Dive into our blog site

Nimbus homepage

Contact options for sales and support