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 |
---|---|
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:
Industry-leading insight reports
Updated 4 months ago