0

I know how to redirect all http request on nginx to https, but if I am only running nginx on a non-standard port (9575) then how can I reject any connections that do not use SSL/TLS?

Zuriar
  • 11,096
  • 20
  • 57
  • 92

1 Answers1

1

According to this answer, this should work:

server {
        listen 9575 ssl;
        error_page 497 https://$host:$server_port$request_uri;
}
Community
  • 1
  • 1
the_nuts
  • 5,634
  • 1
  • 36
  • 68