I am moving to a new domain and have set up 301 redirects on my ec2 instance.
Currently I have the following:
server {
listen 80;
server_name olddomain.co.uk;
return 301 $scheme://www.newdomain.com$request_uri;
}
this works fine for www.olddomain.co.uk and olddomain.co.uk. However it does not work for https://www.olddomain.co.uk
I am wondering how I can make it so the redirect also works with https://www…
Thanks
2
Answers
Your server isn’t listening to
https://
i.e. 443 port. Connection tohttps://www.olddomain.co.uk
would simply be refused. Add proper ssl configurations to your nginx file and it should be fine.