How can i redireect from https to http?
i have the code below but it does not seem to work.
server { listen 443; server_name example.com; rewrite ^(.*) http://example.com$1 permanent; }
The answer above will work, you need to generate a self signed cert (or have a real one) and configure nginx as such:
server { listen *:443; ssl on; server_name domain.com; rewrite ^(.*) http://domain.com$1 permanent; ssl_certificate /data/certs/domain.crt; ssl_certificate_key /data/certs/domain.key; }
Keep in mind, if it is a self signed cert the browser will give you an ugly warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With