Typically my nginx config looks like this:
server {
listen 80;
server_name example.com;
<some long config>
}
server {
listen 443;
server_name example.com;
ssl on;
ssl_certificate qwe.crt;
ssl_certificate_key qwe.key;
<the same long config>
}
How to forward all https requests to http server directive (not send redirect to client but forward within nginx) so that I will not need to write the same config twice?
Found solution:
You simply have two server directives...
Of course you can do this the other way around (https redirect to http) it makes no difference.
In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?