server {
listen 80
return 301 https://domain1.com$request_uri
}
I don’t know why 301 it’s there by default. Should I override that or create a new one above or below it (what you provided). Is server_name necessary?
Will that break the LetsEncrypt renewal process if I redirect everything?
Are you editing nginx.conf inside the discourse container or an external nginx reverse proxy?
If it is internal, you should instead be doing it in the app.yml file. There are multiple examples on how to do that
If you are doing it on an external nginx rp then you can create a new file say redirect.conf in the /etc/nginx/conf.d folder with the configuration example I provided.
@itsbhanusharma I am implementing the code right now. My question is whether LetsEncrypt will renew itself as I intend to live the old server for some time until the URLs are changed by Google. Is there anything I need to add so LetsEncrypt renewal won’t fail due to this 301 redirection change?