Giter Site home page Giter Site logo

nginx's Issues

nginx doesn't use file for name resolution VS docker linking use file for name resolution

i use this entrypoint script as a workaround
lil bit overkill but works for much configurations.

#!/bin/bash
NGINXCONF=/etc/nginx/nginx.conf
#looks for inclusions in nginx conf
NGINXINCLUDES=for i in $(cat $NGINXCONF | grep include | grep -v mime.types | awk '{print $2}' | sed "s/;//g"); do echo "$i"; done

#replace strings that match /etc/hosts 2nd field (fqdn) by the 1st field (ip address)
for i in $(cat /etc/hosts | grep -v localhost | egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | awk '{printf $2" "}')
do
 SEDEX=$(echo "s/$i/$(cat /etc/hosts | egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | grep $i | awk '{printf $1}')/g");
 sed -i "$SEDEX" $NGINXCONF $NGINXINCLUDES
done
#replace strings that match /etc/hosts 3rd field (hostname) by the 1st field (ip address)
#fqdn have already been replaced so, no double replacement (fqdn contains hostname).
for i in $(cat /etc/hosts | grep -v localhost | egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | awk '{printf $3" "}')
do
 SEDEX=$(echo "s/$i/$(cat /etc/hosts | egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | grep $i | awk '{printf $1}')/g");
 sed -i "$SEDEX" $NGINXCONF $NGINXINCLUDES
done

["nginx"] should be the ENTRYPOINT, not CMD

I should be able to do docker run nginx --whatever --commands without having to specify nginx twice.

I'd even go so far as to say that the entrypoint should be ["nginx", "-g", "daemon off;"], but Nginx seems to choke if it finds a duplicate entry for daemon off; in the configuration.

nginx runs directly as root

I discovered a potential issue with the container. The server is started directly from the root user.

Is this an issue, or not? I know the process spawns a child running as www-data, so I may be way off. I just thought I would ask since docker really does not offer secure isolation at this time.

Remove this repo?

Looks like this repo is not used anymore. I spent quite some time until I realized this is not the repo used to build library/nginx today. So maybe this repo should go away or have some deprecation notice?

nginx process not receiving SIGHUP

I tried to restart a running container whose config had changed with:
docker kill -s HUP <container>

However, this event does not turn up in:
docker logs <container>

And, the config was not applied to new requests.

How can I send "reload" to a running nginx container?

Build with packages?

Is there a particular reason why the nginx is compiled from source instead of using the official packages ? Could it be --http-log-path and --error-log-path? I see the problem with additional modules (such as the recently added perl support) but this I believe should be up to the end user. The added benefits of using distribution packages are:

  • Consistent directory layout with the distribution image.
  • Avoids bloating the image with development packages and intermediate build directories.

Consider perhaps publishing two builds: one based off of the nginx package and one off of nginx-extras. This at least allows a choice of core and/or optional nginx modules.

Also, perhaps nitpicking, jessie is still in testing. Perhaps use debian:stable instead of debian:jessie?

Configuration folder & sites configuration as mountable volume

Hi! A couple of suggestions:

  • Configure Nginx build process to place the configuration files inside it's own directory (Currently it places all the files in the /etc folder, mixed up with other configuration files). Actually use the same location used by the .deb distribution.
  • Modify the nginx.conf file used by default so that it loads site conf files from the /etc/nginx/sites-enabled directory, in a similar fashion as the .deb distribution does.
  • Make the /etc/nginx/sites-enabled a mountable volume.
  • Install the nginx executables in the /usr/share directory instead of /usr/local

All this would help to:

  1. Easier for customization, since binary and config files are in the places people familiar with the *.deb packaged version expects them to be.
  2. Apart from specifying a custom nginx.conf via the mounted volumes option, people can also just mount a folder with virtual host sites configuration files.

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.