bwrice
2 months ago
130
0
Forge

Can't enable Let's Encrypt SSL cert when using nginx redirect

Posted 2 months ago by bwrice

I have a production site that's not ready yet located at myapp.com and while it's not ready I want it to redirect to the beta repo site located at the subdomain beta.myapp.com. I've edited the top of my sites nginx file on Forge (for myapp.com) to look as follows:

listen 80;
listen [::]:80;
server_name myapp.com;
return 301 http://beta.myapp.com$request_uri;

The redirect works fine, however my SSL cert now fails to renew and I get the "Your connection is not private" warning when trying to access myapp.com. How can I redirect to the beta site and still have a valid SSL certificate?

Please sign in or create an account to participate in this conversation.