Closed pedrosanchezpernia closed 10 years ago
Hi! You should add this section at the top of site configuration. server { server_name www.stage.example.com; return 301 $scheme://stage.example.com$request_uri; } # server domain rewrite.
You can add the www.stage.example.com
to the redirect. Since you're on a HTTPS only host you can simplify the HTTP server config like this.
server {
server_name www.stage.example.com stage.example.com;
return 301 https://stage.example.com;
}
I'm switching to https and I am trying to have 3 cases to redirect to https://stage.example.com. My conf is based on the standard example.com.conf, and so far this is the problem.
ok: https://stage.example.com http://stage.example.com >> https://stage.example.com bad: http://www.stage.example.com >> show the default "t works" page https://www.stage.example.com >> page not available
I am using return 301 https://stage.example.com$request_uri; at the end of "server listen 80"
Thanks for any tips.