How To: Enhance Your Sites with Custom NGINX Configuration

<!DOCTYPE html>

# 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](https://app.nimbushosting.co.uk/websites)

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

![](https://internal.kesisis.com/article_attachments/9592757356829/4794f1e342f401428be2567c26bf0471.png)

3\. From the navigation bar click "Advanced"

![](https://internal.kesisis.com/article_attachments/9592757356829/f21838bddd9519b841a30047fce85fbc.png)

4\. Click "Configure NGINX"

![](https://internal.kesisis.com/article_attachments/9592757356829/4b0f0e60f755deb0a250398fc54c7a11.png)

5\. Insert your custom configuration into the textbox

![](https://internal.kesisis.com/article_attachments/9592757356829/4929948d65cdd285486adde5efc2e74b.png)

6\. Click "Update NGINX"

![](https://internal.kesisis.com/article_attachments/9592757356829/77d5b7ed8353201ea62fd95d5a4c4cb0.png)

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                  |
| -------------------------- | ----------------------- |
| rewrite                    | proxy_pass              |
| alias                      | limit_except            |
| fastcgi_pass               | uwsgi_pass              |
| scgi_pass                  | try_files               |
| if                         | error_page              |
| add_header                 | expires                 |
| set                        | auth_basic              |
| allow/deny                 | allow_methods           |
| satisfy                    | internal                |
| open_file_cache            | Content Security Policy |
| limit_rate                 | valid_referers          |
| map                        |                         |

**Looking for something else?**

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

[Support Hub homepage](https://support.nimbushosting.co.uk/hc/en-gb)

[Upgrade your package](https://nimbushosting.co.uk/pricing)

[Industry-leading insight reports](https://nimbushosting.co.uk/resources?category=reports#group)

[Insightful webinar replays](https://nimbushosting.co.uk/resources?category=webinars#group)

[Expertly crafted e-book business guides](https://nimbushosting.co.uk/resources?category=e-books#group)

[Dive into our blog site](https://nimbushosting.co.uk/blog)

[Nimbus homepage](https://nimbushosting.co.uk/)

[Contact options for sales and support](https://nimbushosting.co.uk/contact)