Improve HTTPS redirection

This commit is contained in:
Wojciech Kozlowski 2017-09-17 03:24:15 +01:00
parent 05aee61493
commit 9b80571567
5 changed files with 56 additions and 17 deletions

View File

@ -1,3 +1,17 @@
server {
listen 80;
server_name cloud.wojciechkozlowski.eu;
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name cloud.wojciechkozlowski.eu;

View File

@ -1,3 +1,17 @@
server {
listen 80;
server_name gitlab.wojciechkozlowski.eu;
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name gitlab.wojciechkozlowski.eu;

View File

@ -1,3 +1,17 @@
server {
listen 80;
server_name wiki.wojciechkozlowski.eu;
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name wiki.wojciechkozlowski.eu;

View File

@ -1,3 +1,17 @@
server {
listen 80;
server_name wojciechkozlowski.eu;
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name wojciechkozlowski.eu;

View File

@ -25,23 +25,6 @@ http {
#gzip on;
server {
listen 80;
server_name wojciechkozlowski.eu
cloud.wojciechkozlowski.eu
gitlab.wojciechkozlowski.eu
wiki.wojciechkozlowski.eu;
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}
ssl_certificate /etc/letsencrypt/live/wojciechkozlowski.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wojciechkozlowski.eu/privkey.pem;