Merge b1322d8771 into d831c058f3
This commit is contained in:
commit
3fd2f75167
3 changed files with 26 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
FROM nginx:1.7.8
|
FROM nginx:1.7.8
|
||||||
MAINTAINER Jason Wilder jwilder@litl.com
|
MAINTAINER https://m-ko-x.de Markus Kosmal <code@m-ko-x.de>
|
||||||
|
|
||||||
# Install wget and install/updates certificates
|
# install packages
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y -q --no-install-recommends \
|
&& apt-get install -y -q --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|
@ -12,7 +12,7 @@ RUN apt-get update \
|
||||||
# Configure Nginx and apply fix for very long server names
|
# Configure Nginx and apply fix for very long server names
|
||||||
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
||||||
&& sed -i 's/^http {/&\n server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf
|
&& sed -i 's/^http {/&\n server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# Install Forego
|
# Install Forego
|
||||||
RUN wget -P /usr/local/bin https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego \
|
RUN wget -P /usr/local/bin https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego \
|
||||||
&& chmod u+x /usr/local/bin/forego
|
&& chmod u+x /usr/local/bin/forego
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
 
|
 
|
||||||
|
|
||||||
|
##Modifications
|
||||||
|
|
||||||
|
To make Jason's nginx-proxy work for me, I changed:
|
||||||
|
|
||||||
|
- added rewrite of 'www'-prefixed domains to 301 without prefix for both https and http protocol
|
||||||
|
|
||||||
|
##Original
|
||||||
|
|
||||||
nginx-proxy sets up a container running nginx and [docker-gen][1]. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
|
nginx-proxy sets up a container running nginx and [docker-gen][1]. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
|
||||||
|
|
||||||
See [Automated Nginx Reverse Proxy for Docker][2] for why you might want to use this.
|
See [Automated Nginx Reverse Proxy for Docker][2] for why you might want to use this.
|
||||||
|
|
|
||||||
15
nginx.tmpl
15
nginx.tmpl
|
|
@ -87,11 +87,19 @@ upstream {{ $host }} {
|
||||||
{{ if (and (ne $cert "") (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) }}
|
{{ if (and (ne $cert "") (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) }}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
client_max_body_size 1000m;
|
||||||
|
server_name www.{{ $host }};
|
||||||
|
rewrite ^(.*) https://{{ $host }}$1 permanent;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
client_max_body_size 1000m;
|
||||||
server_name {{ $host }};
|
server_name {{ $host }};
|
||||||
rewrite ^(.*) https://{{ $host }}$1 permanent;
|
rewrite ^(.*) https://{{ $host }}$1 permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
client_max_body_size 1000m;
|
||||||
server_name {{ $host }};
|
server_name {{ $host }};
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
|
|
||||||
|
|
@ -122,6 +130,13 @@ server {
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
client_max_body_size 1000m;
|
||||||
|
server_name www.{{ $host }};
|
||||||
|
rewrite ^(.*) http://{{ $host }}$1 permanent;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
client_max_body_size 1000m;
|
||||||
server_name {{ $host }};
|
server_name {{ $host }};
|
||||||
|
|
||||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue