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

[Question] How to use custom nginx.conf? #26

Open
EinHecki opened this issue May 31, 2021 · 4 comments
Open

[Question] How to use custom nginx.conf? #26

EinHecki opened this issue May 31, 2021 · 4 comments

Comments

@EinHecki
Copy link

I'm using the nginx-php8 tag and I want to change some custom things. How can I do that?

@daohoangson
Copy link
Contributor

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.

@EinHecki
Copy link
Author

EinHecki commented Jun 1, 2021

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?

@daohoangson
Copy link
Contributor

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.

@EinHecki
Copy link
Author

EinHecki commented Jun 3, 2021

I now got it working by mounting my nginx.conf into /opt/templates/nginx.conf.

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

No branches or pull requests

2 participants