nginx redirect multiple servers to SSL -
i have code. want each of server_name in list redirect own name https. but, if http://beta.example.com, redirects https://api.example.com (or whatever first item in list is)
server { listen 80; server_name api.example.com beta.example.com apibeta.example.com nodebeta.example.com app.example.com; return 301 https://$server_name$request_uri; }
you should able use $host
variable instead:
server { listen 80; server_name api.example.com beta.example.com apibeta.example.com nodebeta.example.com app.example.com; return 301 https://$host$request_uri; }
Comments
Post a Comment