Comments (7)
Hi Brennan,
Thanks for your input! I've done some changes that hopefully help you.
First I've changed the temporary/cache paths in Nginx to /tmp
to resolve #16
Nginx recommends this for their own image as well; https://hub.docker.com/_/nginx
Secondly, I've added an Include /etc/nginx/conf.d/*.conf
to nginx.conf that allows you to extend the config by mounting files in that folder.
For example; docker run -v "myconfig.conf:/etc/nginx/conf.d/myconfig.conf" ...
I've not broken down the config in separate files to keep it simple and easy to understand.
Let me know if this works for you!
from docker-php-nginx.
I'll close this issue. If you have any questions, let me know!
from docker-php-nginx.
Perhaps splitting the config like handled in this project would make sense? They have a very small server conf and include conf files for the rest.
It looks like you could just do the reverse, and include a conf file for the server root? Easy to override then.
from docker-php-nginx.
Hi Brennan,
Thank you for your suggestion! The original idea for this image was to make it an example how you can setup a container image with Nginx & PHP-FPM using some best practices and keep it as simple as possible. So I intentionally left out a 'modular config' setup to keep it straight forward and easy to understand for everyone. If you want to change something (and you probably need to) then you can fork it or copy it to your own setup.
But I see that more and more people are using this image as it is because it already covers some use cases. So I need to change this strategy a bit to still have it as an example but also making it a bit easier to extend while still being able to update when I push new changes.
I'm already working on that and will update this image soon.
For your case; indeed, changing the root in nginx.conf
would be the way to go.
from docker-php-nginx.
I'll close this issue. If you have any questions, just re-open it!
from docker-php-nginx.
I'm not able to re-open the issue as I don't have permission. How do you feel with the earlier suggestion of breaking out some of the nginx.conf file into smaller conf files? You did state that you were working towards an update that might accommodate that?
For the issue in #16 I was able to just add an include ./adjustments/http.conf;
into the nginx.conf
http{}
block, I placed it after the include mime.types;
line and mounted the file from host to /etc/nginx/adjustments/http.conf
. Nginx required all 5 paths to be adjusted to the /tmp
location as shown in the linked issue(exact content of the file), then it would start successfully without permission errors on older kernels.
Would you like me to submit a PR that adds an include block for user additions in /etc/nginx/adjustments
? And/or splitting the config for http and server blocks? Something like the earlier referenced project, which is pretty nice(except the fastgi.conf/mime.types files, those can be ignored, as they are included by default with nginx, I'm not sure why the project adds them).
from docker-php-nginx.
Hi, sorry for commenting on this old issue but I have a question:
How can I change the root-folder of nginx? I've already mounted a file (like -v "myconfig.conf:/etc/nginx/conf.d/myconfig.conf"
) but now my nginx fails to start because of the invalid configuration in there :D
from docker-php-nginx.
Related Issues (20)
- Tag by php version HOT 1
- Add composer by default HOT 1
- [Question] Turn off "nobody" user HOT 10
- Weird Issue with Volumes. HOT 4
- Unable to set custom DNS HOT 2
- Add php_ldap HOT 1
- supervisorctl not working HOT 2
- Optimize PHP-FPM with JIT HOT 3
- Clean up nginx config HOT 2
- vscode-server` HOT 4
- docker-php-nginx with PHP 8.3? HOT 1
- Newrelic APM support HOT 4
- application/javascript mime type is missing in gzip_types HOT 1
- image Performing a pressure test using Apache Benchmark (ab).
- installing php extensions HOT 1
- Weird PSR-7 request target for current nginx default.conf with path info HOT 1
- Version mismatch (latest !=3.5.0 HOT 3
- I cannot run commands like "composer install" when using Windows WSL
- where are php_errors written? HOT 2
- setting permission to properly handle file uploads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-php-nginx.