[nginx] How to redirect an existing domain to a new one

Asked 2 years ago, Updated 2 years ago, 48 views

Hello, I would like to set up Nginx to redirect the existing domain to the new domain.

If the existing domain was hashcode.me, the current domain is hashcode.com.

Therefore, HTTP/HTTPS requests from existing domains and HTTP requests from new domains must be redirected to HTTPS from the new domain The existing domain does not have a separate certificate (the new domain has a certificate). Perhaps that's why when I request the existing domain with HTTPS, the browser stops with the message that it is not redirected and dangerous. In this case, I would like to know if I need to purchase another certificate or if there is another way to set it up.

Thank you for your reply. :)

nginx tls

2022-09-22 08:06

1 Answers

How about using the free ssl service?

There are things like cloudflare.com and startssl

If you register the dns name server of the domain as a cloudflare at cloudflare.com, you can manage dns (link the address changed to cname), and ssl is also supported free of charge.


2022-09-22 08:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.