[MISC] Automatically redirect from http to https in suites. (#769)

pull/771/head
Clément Michaud 2020-03-22 07:04:51 +01:00 committed by GitHub
parent d95bda8cdc
commit c3a2e70d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -22,6 +22,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
# Serve the backend API for the portal. # Serve the backend API for the portal.
location /api { location /api {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@ -68,6 +70,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;
@ -95,6 +99,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
# Reverse proxy to the backend. It is protected by Authelia by forwarding authorization checks # Reverse proxy to the backend. It is protected by Authelia by forwarding authorization checks
# to the virtual endpoint introduced by nginx and declared in the next block. # to the virtual endpoint introduced by nginx and declared in the next block.
location / { location / {
@ -187,6 +193,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;
@ -207,6 +215,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;

View File

@ -22,6 +22,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
# Serve the backend API for the portal. # Serve the backend API for the portal.
location /api { location /api {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@ -68,6 +70,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;
@ -95,6 +99,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
# Reverse proxy to the backend. It is protected by Authelia by forwarding authorization checks # Reverse proxy to the backend. It is protected by Authelia by forwarding authorization checks
# to the virtual endpoint introduced by nginx and declared in the next block. # to the virtual endpoint introduced by nginx and declared in the next block.
location / { location / {
@ -187,6 +193,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;
@ -207,6 +215,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
error_page 497 301 =307 https://$host:$server_port$request_uri;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_pass $upstream_endpoint; proxy_pass $upstream_endpoint;