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
|
#fix for long server names
|
||||||
RUN sed -i 's/# server_names_hash_bucket/server_names_hash_bucket/g' /etc/nginx/nginx.conf
|
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
|
RUN mkdir /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD . /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
|
RUN tar xvzf docker-gen-linux-amd64-0.3.2.tar.gz
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
ENV DOCKER_HOST unix:///tmp/docker.sock
|
ENV DOCKER_HOST unix:///tmp/docker.sock
|
||||||
|
|
||||||
CMD ["forego", "start", "-r"]
|
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
|
19
nginx.tmpl
19
nginx.tmpl
|
@ -1,7 +1,10 @@
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
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.
|
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
||||||
error_log /proc/self/fd/2;
|
error_log /var/log/nginx/error.log;
|
||||||
access_log /proc/self/fd/1;
|
access_log /proc/self/fd/1;
|
||||||
return 503;
|
return 503;
|
||||||
}
|
}
|
||||||
|
@ -43,18 +46,18 @@ upstream {{ $host }} {
|
||||||
server {
|
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 }};
|
server_name {{ $host }};
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
error_log /proc/self/fd/2;
|
error_log /var/log/nginx/error.log;
|
||||||
access_log /proc/self/fd/1;
|
access_log /proc/self/fd/1;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://{{ $host }};
|
proxy_set_header Host $host;
|
||||||
include /etc/nginx/proxy_params;
|
|
||||||
|
|
||||||
# HTTP 1.1 support
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Connection "";
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_pass http://{{ $host }};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue