Git Product home page Git Product logo

Comments (7)

stuartpb avatar stuartpb commented on July 27, 2024

I've been getting by in plushu/plushu-container by mounting my Nginx conf volume in /usr/local/nginx/etc and just explicitly specifying the location with -c.

If this is proposing setting the default prefix to /etc/nginx and the default config to /etc/nginx/nginx.conf, I'm all for that (it'd be one less thing to specify and one less difference I'd have to worry about between running my configuration in a container vs. on the host).

I don't know anything about the default nginx.conf or sites-enabled, I don't use either of those. (https://github.com/plushu/plushu-nginx-container/blob/master/install should give a fair idea of what Plushu's Nginx setup looks like)

from nginx.

yosifkit avatar yosifkit commented on July 27, 2024

I like moving the conf files to their own folder in /etc. We should incorporate this idea into the other base images so that configuration is easier to override, esp given moby/moby#6011.

from nginx.

AsavarTzeth avatar AsavarTzeth commented on July 27, 2024

I second this. In fact I tried to get it in a pull request way back but then it was of no interest for some reason.

Happy to see it coming anyways.

from nginx.

felixhummel avatar felixhummel commented on July 27, 2024

Here's what I use: felixhummel@a06716a

Interesting bits

--conf-path=/etc/nginx/nginx.conf
--prefix=/nginx

And the run looks like this:

docker run \
    -v /some/data/dir:/nginx \
    -v /config/dir/etc:/etc/nginx \
    nginx:latest

Not perfect, but works for me. I guess we need some best practices / standards guide for those kind of things. /nginx seems like a hack to me, but I wanted it separate from the config.

from nginx.

stuartpb avatar stuartpb commented on July 27, 2024

Assuming /nginx contains your site pages etc, maybe use /var/www or /var/www/html?

from nginx.

felixhummel avatar felixhummel commented on July 27, 2024
  1. conf-path and prefix should be separate, because
    • include foo.conf then refers to $(dirname $conf-path)/foo.conf for configs and
    • root bar refers to $prefix/bar for static data
  2. conf-path should be /etc/nginx/nginx.conf to allow mounting of /etc/nginx or putting those configs in the container
  3. prefix should then be /var/www (Debian-style), which could be mounted completely or split up into /var/www/site_a and /var/www/site_b

See also http://nginx.org/en/docs/configure.html

from nginx.

yosifkit avatar yosifkit commented on July 27, 2024

So, the new images will have /etc/nginx/ volume and should be up on the hub in the next 4-5 hours.

Nginx upstream will now be providing and maintaining the images nginxinc/docker-nginx.

from nginx.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.