Pregunta

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 .

¿Fue útil?

Solución

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;
  }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top