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=8cfe928dc2127a485d1aa5970bccc9f0e5db0c5d;p=mezzo.git Add nginx optional htpasswd access --- diff --git a/docker-compose.yml b/docker-compose.yml index ea4508d8..10569c1d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,6 +68,7 @@ nginx: - "8022: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 1ec08728..ea325b52 100644 --- a/etc/nginx/conf.d/default.conf +++ b/etc/nginx/conf.d/default.conf @@ -1,39 +1,40 @@ server_tokens off; -server { - listen 80; - server_name starts.eu; - return 301 $scheme://www.starts.eu$request_uri; -} +#server { +# listen 80; +# server_name starts.eu; +# return 301 $scheme://www.starts.eu$request_uri; +#} server { - listen 80; - charset utf-8; - server_name *.starts.eu vertigo.*; - - 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 36b6bffa..adaeaedd 160000 --- a/lib/mezzanine +++ b/lib/mezzanine @@ -1 +1 @@ -Subproject commit 36b6bffac40111c37fd3f0ef435ffc3f79f93793 +Subproject commit adaeaedd970fcd8d4a26fa94605c721ae163271f diff --git a/lib/mezzanine-agenda b/lib/mezzanine-agenda index fc5d200f..036a5c7e 160000 --- a/lib/mezzanine-agenda +++ b/lib/mezzanine-agenda @@ -1 +1 @@ -Subproject commit fc5d200fbb5c8ef1a6058a78c8a80ae34658cfa4 +Subproject commit 036a5c7e7bd4f744c1cf36fc332fd3ce3f9c9aa7