Skip to content

Instantly share code, notes, and snippets.

@pentago
Created December 18, 2018 13:18
Show Gist options
  • Save pentago/4d61dcb650ed7aada18cce29a50c2866 to your computer and use it in GitHub Desktop.
Save pentago/4d61dcb650ed7aada18cce29a50c2866 to your computer and use it in GitHub Desktop.
// Mobile Site Nginx config
// Redirects all traffic from http://m.sangfor.com to http://m.sangfor.com
server {
listen 80;
server_name m.sangfor.com;
return 301 https://m.sangfor.com$request_uri;
}
server {
listen 443;
server_name m.sangfor.com;
(...rest of mobile site server block configs...)
}
// Website Nginx config
// Redirects all traffic from http://sangfor.com, http://www.sangfor.com and https://sangfor.com to https://www.sangfor.com
server {
listen 80;
server_name sangfor.com www.sangfor.com;
return 301 https://www.sangfor.com$request_uri;
}
server {
listen 443;
server_name sangfor.com;
return 301 https://www.sangfor.com$request_uri;
}
server {
listen 443;
server_name www.sangfor.com;
(...rest of m-site server block configs...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment