From: Guillaume Pellerin Date: Thu, 23 Mar 2017 16:44:17 +0000 (+0100) Subject: Add nginx optional htpasswd access X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=68fce393fb2bcac944b0f2825d672d3c67c02a27;p=mezzo.git Add nginx optional htpasswd access --- diff --git a/docker-compose.yml b/docker-compose.yml index 0e4d5916..b7b1bccd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,6 +65,7 @@ nginx: - "8021:80" volumes: - ./etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf + - ./etc/nginx/htpasswd:/etc/nginx/htpasswd volumes_from: - var links: diff --git a/etc/nginx/conf.d/default.conf b/etc/nginx/conf.d/default.conf index 9fca538b..ea325b52 100644 --- a/etc/nginx/conf.d/default.conf +++ b/etc/nginx/conf.d/default.conf @@ -1,32 +1,40 @@ server_tokens off; +#server { +# listen 80; +# server_name starts.eu; +# return 301 $scheme://www.starts.eu$request_uri; +#} + server { - listen 80; - charset utf-8; - - access_log /var/log/nginx/app-access.log; - error_log /var/log/nginx/app-error.log; - - # max upload size - client_max_body_size 4096M; # adjust to taste - - # Django media - location /media { - alias /srv/media; # your Django project's media files - amend as required - } - - # Django static - location /static { - alias /srv/static; # your Django project's static files - amend as required - } - - # Django static - location /doc { - alias /srv/doc/build/html; # your Django project's static files - amend as required - } - - location / { - uwsgi_pass app:8000; - include /etc/nginx/uwsgi_params; - } + listen 80; + charset utf-8; + server_name _; + + access_log /var/log/nginx/app-access.log; + error_log /var/log/nginx/app-error.log; + + # max upload size + client_max_body_size 4096M; + + # Django media + location /media/ { + alias /srv/media/; + } + + # Django static + location /static/ { + alias /srv/static/; + } + + # Django static + location /doc/ { + alias /srv/doc/build/html/; + } + + location / { + uwsgi_pass app:8000; + include /etc/nginx/uwsgi_params; + #auth_basic_user_file /etc/nginx/htpasswd; + } } diff --git a/etc/nginx/htpasswd b/etc/nginx/htpasswd new file mode 100644 index 00000000..48d6e8a3 --- /dev/null +++ b/etc/nginx/htpasswd @@ -0,0 +1 @@ +mezzorg:$apr1$EpiFKm0X$R0glyFNEjKEcO/4AUGtWv0 diff --git a/lib/mezzanine b/lib/mezzanine index 51cf69d9..adaeaedd 160000 --- a/lib/mezzanine +++ b/lib/mezzanine @@ -1 +1 @@ -Subproject commit 51cf69d973848f08bc482022fd5bdac9a41f8ff9 +Subproject commit adaeaedd970fcd8d4a26fa94605c721ae163271f diff --git a/lib/mezzanine-agenda b/lib/mezzanine-agenda index 2b2de20c..036a5c7e 160000 --- a/lib/mezzanine-agenda +++ b/lib/mezzanine-agenda @@ -1 +1 @@ -Subproject commit 2b2de20c2ecbe6b7a5a56eb30c8ccb942eba434c +Subproject commit 036a5c7e7bd4f744c1cf36fc332fd3ce3f9c9aa7