diff --git a/Dockerfile b/Dockerfile index 73505de..cd81ec8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,17 @@ RUN useradd --create-home nexus ; \ echo "nexus:nexus" | chpasswd # Install nginx -RUN apt-get install -y nginx-light +RUN apt-get install -y nginx-light fcgiwrap # Configure nginx -RUN echo "daemon off;" >> /etc/nginx/nginx.conf +RUN echo "daemon off;" >> /etc/nginx/nginx.conf ; cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf COPY nginx.conf /etc/supervisor/conf.d/nginx.conf +COPY fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf COPY default /etc/nginx/sites-available/default +COPY clear-sockets /start.d/clear-sockets + +RUN chmod +x /start.d/clear-sockets EXPOSE 80 diff --git a/clear-sockets b/clear-sockets new file mode 100644 index 0000000..8098265 --- /dev/null +++ b/clear-sockets @@ -0,0 +1,3 @@ +#!/bin/sh +rm /tmp/fcgiwrap.socket + diff --git a/default b/default index 832b86c..0ed8412 100644 --- a/default +++ b/default @@ -14,4 +14,10 @@ server { autoindex on; try_files $uri $uri/ =404; } + location /cgi-bin/ { + gzip off; + fastcgi_pass unix:/tmp/fcgiwrap.socket; + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME /nexus$fastcgi_script_name; + } } diff --git a/fcgiwrap.conf b/fcgiwrap.conf new file mode 100644 index 0000000..fa0bc4a --- /dev/null +++ b/fcgiwrap.conf @@ -0,0 +1,4 @@ +[program:fcgiwrap] +user=www-data +command=/usr/sbin/fcgiwrap -f -s unix:/tmp/fcgiwrap.socket +autorestart=true