Skip to content

Commit

Permalink
Properly redirect http to https (#1418)
Browse files Browse the repository at this point in the history
Can't use $server_name because it ends up redirecting to 127.0.0.1. Instead, using $host will redirect the site to the appropriate host.
  • Loading branch information
epicfaace authored Sep 24, 2019
1 parent 9face7c commit 6dd3d2b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docker/compose_files/files/nginx.conf.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ http {

# Redirects all http traffic to https.
server {
listen 80;
server_name 127.0.0.1 localhost;
listen 80;
location / {
rewrite ^ https://$server_name$request_uri permanent;
rewrite ^ https://$host$request_uri permanent;
}
}

Expand Down

0 comments on commit 6dd3d2b

Please sign in to comment.