Question

I just want to redirect my url

https://www.example.com to http://www.example.com

Just this single link

How can I do that in nginx in the vhosts file .

I don't have any idea about how it works as I am new to nginx . Any help is appreciated .

Was it helpful?

Solution

Like I said this is dependent on you having your functioning certificate

server {
  listen 443 ssl;
  # add ssl settings here
  server_name www.example.com;
  return 301 http://www.example.com;
}

EDIT: only redirecting only the root URL

server {
  listen 443 ssl;
  # add ssl settings
  location = / {
    return 301 http://www.example.com;
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top