diff --git a/config/heroku/nginx.conf b/config/heroku/nginx.conf index 8b56b05e1c..029ca1b561 100644 --- a/config/heroku/nginx.conf +++ b/config/heroku/nginx.conf @@ -2,8 +2,9 @@ #rewrite ^/bar/foo(/.*|$) /under/this/path$1 redirect; #add_header Strict-Transport-Security "max-age=864000"; -#if ($http_x_forwarded_proto != "https") { return 301 https://www.example.com$request_uri; } -#if ($host != "www.example.com") { return 302 $http_x_forwarded_proto://www.example.com$request_uri; } +#if ($http_x_forwarded_proto != "https") { return 301 https://$host$request_uri; } +env NGINX_HOST_NAME; +if ($host != $nginx_host_name) { return 302 $http_x_forwarded_proto://$nginx_host_name$request_uri; } client_max_body_size 500M; real_ip_header X-Forwarded-For;