[Question] How to use custom nginx.conf?
Opened this issue · 4 comments
I'm using the nginx-php8 tag and I want to change some custom things. How can I do that?
Depending on how much customization you are looking for. If you want nginx to listen to a new port etc., you can mount new files into /etc/nginx/conf.d/
and they will be loaded automatically. If you want to customize /etc/nginx/nginx.conf
, it may be easier to copy the file from this repo, make changes as needed then mount it into the official nginx
image.
I want to change the client_max_body_size
. When I mount my custom nginx.conf
to /etc/nginx/nginx.conf
the file will be overwritten again. So would I need to customize your Image and build it by myself?
If you have a custom nginx.conf
, you should just use the official nginx
image (you don't need to rebuild it yourself).
Of course, you may need to mount the default.conf
file too. Given that you can customize the other file, this one should be fairly straightforward.
I now got it working by mounting my nginx.conf
into /opt/templates/nginx.conf
.