diff options
-rw-r--r-- | custom/ymir-nginx.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix index 701a1108..b61c448c 100644 --- a/custom/ymir-nginx.nix +++ b/custom/ymir-nginx.nix | |||
@@ -175,8 +175,6 @@ in { | |||
175 | listen [::]:443 ssl; | 175 | listen [::]:443 ssl; |
176 | server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; | 176 | server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; |
177 | 177 | ||
178 | include ${acme}; | ||
179 | |||
180 | location / { | 178 | location / { |
181 | auth_basic "Reverse proxy to bragi"; | 179 | auth_basic "Reverse proxy to bragi"; |
182 | auth_basic_user_file /srv/www/bragi/htpasswd; | 180 | auth_basic_user_file /srv/www/bragi/htpasswd; |
@@ -186,6 +184,8 @@ in { | |||
186 | } | 184 | } |
187 | 185 | ||
188 | server { | 186 | server { |
187 | listen *:80; | ||
188 | listen [::]:80; | ||
189 | listen *:443 ssl; | 189 | listen *:443 ssl; |
190 | listen [::]:443 ssl; | 190 | listen [::]:443 ssl; |
191 | 191 | ||
@@ -194,6 +194,10 @@ in { | |||
194 | include ${acme}; | 194 | include ${acme}; |
195 | 195 | ||
196 | location ~ ^/(.+?)(/.*)?$ { | 196 | location ~ ^/(.+?)(/.*)?$ { |
197 | if ($scheme = http) { | ||
198 | return 301 https://$server_name$request_uri; | ||
199 | } | ||
200 | |||
197 | alias /srv/www/webdav/$1$2; | 201 | alias /srv/www/webdav/$1$2; |
198 | autoindex on; | 202 | autoindex on; |
199 | 203 | ||