Skip to content

Instantly share code, notes, and snippets.

@dg dg/ssl.conf
Created Dec 14, 2015

Embed
What would you like to do?
Redirect to HTTPS for all except Windows XP
server {
...
listen 443 ssl;
listen 80;
if ($server_port = 80) {
set $xp A;
}
if ($http_user_agent !~ "Windows NT 5\.[12]") {
set $xp "${xp}B";
}
if ($xp = AB) {
return 301 https://$host$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.