Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix http -> https redirects #18

Open
timbod7 opened this issue Mar 18, 2020 · 1 comment
Open

Fix http -> https redirects #18

timbod7 opened this issue Mar 18, 2020 · 1 comment

Comments

@timbod7
Copy link
Contributor

timbod7 commented Mar 18, 2020

The code will current generate a proxy config like:

  server {
    listen 80;
    server_name app.powerlinespro.com app.prod.powerlinespro.com api.prod.powerlinespro.com app.powerlinespro.co;
    location '/.well-known/acme-challenge' {
        default_type "text/plain";
        alias /opt/var/www/.well-known/acme-challenge;
    }
    location / {
      return 301 https://$server_name$request_uri;
    }
  }

But this always redirects to the first server name as per here:

https://serverfault.com/questions/706438/what-is-the-difference-between-nginx-variables-host-http-host-and-server-na

Looks like we need to change $server_name to $host

@timbod7
Copy link
Contributor Author

timbod7 commented Mar 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant