Merge 05cb2542f0
into 6024b7bdf3
This commit is contained in:
commit
59b1b138a5
4 changed files with 30 additions and 19 deletions
|
@ -13,6 +13,10 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
|
|||
#fix for long server names
|
||||
RUN sed -i 's/# server_names_hash_bucket/server_names_hash_bucket/g' /etc/nginx/nginx.conf
|
||||
|
||||
# Generate dummy SSL certificates
|
||||
RUN mkdir /ssl
|
||||
RUN openssl req -new -x509 -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.org" -nodes -out /ssl/nginx.pem -keyout /ssl/nginx.key
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
|
@ -24,6 +28,7 @@ RUN wget https://github.com/jwilder/docker-gen/releases/download/0.3.2/docker-ge
|
|||
RUN tar xvzf docker-gen-linux-amd64-0.3.2.tar.gz
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
ENV DOCKER_HOST unix:///tmp/docker.sock
|
||||
|
||||
CMD ["forego", "start", "-r"]
|
||||
|
|
0
access.log
Normal file
0
access.log
Normal file
3
error.log
Normal file
3
error.log
Normal file
|
@ -0,0 +1,3 @@
|
|||
2014/08/23 14:25:03 [notice] 27#0: signal process started
|
||||
2014/08/23 14:25:05 [notice] 33#0: signal process started
|
||||
2014/08/23 14:25:07 [notice] 38#0: signal process started
|
41
nginx.tmpl
41
nginx.tmpl
|
@ -1,9 +1,12 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
||||
error_log /proc/self/fd/2;
|
||||
access_log /proc/self/fd/1;
|
||||
return 503;
|
||||
listen 80;
|
||||
listen 443 default_server ssl;
|
||||
ssl_certificate /ssl/nginx.pem;
|
||||
ssl_certificate_key /ssl/nginx.key;
|
||||
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /proc/self/fd/1;
|
||||
return 503;
|
||||
}
|
||||
|
||||
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
||||
|
@ -41,20 +44,20 @@ upstream {{ $host }} {
|
|||
}
|
||||
|
||||
server {
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
listen 80;
|
||||
listen 443 ssl;
|
||||
server_name {{ $host }};
|
||||
proxy_buffering off;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /proc/self/fd/1;
|
||||
|
||||
server_name {{ $host }};
|
||||
proxy_buffering off;
|
||||
error_log /proc/self/fd/2;
|
||||
access_log /proc/self/fd/1;
|
||||
|
||||
location / {
|
||||
proxy_pass http://{{ $host }};
|
||||
include /etc/nginx/proxy_params;
|
||||
|
||||
# HTTP 1.1 support
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://{{ $host }};
|
||||
}
|
||||
}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue