From 2faf437cc5c14ac5bcc9effd5c962145d05d8e3c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Mar 2017 14:51:26 +0100 Subject: Reverse proxy to bragi --- custom/ymir-nginx.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'custom') diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix index 46256328..0d0ed8ce 100644 --- a/custom/ymir-nginx.nix +++ b/custom/ymir-nginx.nix @@ -136,6 +136,29 @@ in { uwsgi_modifier1 9; } } + + server { + server *:80; + server [::]:80; + server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; + + return 301 https://$host$request_uri; + } + + server { + server *:443 ssl; + server [::]:443 ssl; + server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; + + include ${acme}; + + location / { + auth_basic "Reverse proxy to bragi"; + auth_basic_user_file /srv/www/bragi/htpasswd; + + proxy_pass http://bragi.asgard.yggdrasil/; + } + } ''; }; } -- cgit v1.2.3