Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include for root_top.conf in the nginx.conf #3766

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

kroegerama
Copy link
Contributor

This pull request allows custom configuration of the root config in the top of the file. This can be used to load modules, which is not possible at the end of the config file. There is already a http_top.conf, so root_top.conf is a logical addition.

The PR NginxProxyManager/docker-nginx-full#28 added the geoip2 module as requested in Issue #46. But currently there is no way to actually load the modules if you cannot mount custom files to /etc/nginx/modules/ like in the Truenas Scale NPM App.

Now you can just add a root_top.conf to the persistent mounted /data/custom folder and add the following content:

load_module /usr/lib/nginx/modules/ngx_http_geoip2_module.so;
load_module /usr/lib/nginx/modules/ngx_stream_geoip2_module.so;

Allow custom configuration of the root config in the top of the file. This can be used to load modules, which is not possible at the end of the config file.
There is already a `http_top.conf`, so `root_top.conf` is a logical addition.
@jc21
Copy link
Member

jc21 commented May 20, 2024

These custom includes are getting wild.

Can you please update the documentation with this addition as well:
https://nginxproxymanager.com/advanced-config/#custom-nginx-configurations

This file can be found at docs/src/advanced-config/index.md

describe the `root_top.conf` file and add a snippet for enabling the geoip2 module
@kroegerama
Copy link
Contributor Author

Thank you so much for your fast response! I updated the documentation and added a small snippet on how to enable the geoip2 module.
If you don't want the snippet in the documentation, let me know so I can remove it.

@nginxproxymanagerci
Copy link

Docker Image for build 2 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-3766

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@jc21 jc21 merged commit 120d50e into NginxProxyManager:develop Jul 1, 2024
1 check passed
@webysther webysther mentioned this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants