Add cgi-bin, lighter ngnix

This commit is contained in:
dave 2015-05-23 15:02:35 -07:00
parent d0dfee2531
commit 3fefb167b3
4 changed files with 19 additions and 2 deletions

View File

@ -6,13 +6,17 @@ RUN useradd --create-home nexus ; \
echo "nexus:nexus" | chpasswd echo "nexus:nexus" | chpasswd
# Install nginx # Install nginx
RUN apt-get install -y nginx-light RUN apt-get install -y nginx-light fcgiwrap
# Configure nginx # 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 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 default /etc/nginx/sites-available/default
COPY clear-sockets /start.d/clear-sockets
RUN chmod +x /start.d/clear-sockets
EXPOSE 80 EXPOSE 80

3
clear-sockets Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
rm /tmp/fcgiwrap.socket

View File

@ -14,4 +14,10 @@ server {
autoindex on; autoindex on;
try_files $uri $uri/ =404; 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;
}
} }

4
fcgiwrap.conf Normal file
View File

@ -0,0 +1,4 @@
[program:fcgiwrap]
user=www-data
command=/usr/sbin/fcgiwrap -f -s unix:/tmp/fcgiwrap.socket
autorestart=true