Nginx SSL/Subdomain/IP redirect
Please check running with following config, this should work.
#This would serve all your content.server { listen 443 ssl spdy default deferred; server_name example.com; ... more configs}#https calls to anything except example.com would be redirected here server { listen 443 ssl spdy default deferred; #(Can also use only : "listen 443;") server_name *.example.com 123.123.123.123; return 301 https://example.com$request_uri;}#All port 80 redirection to https://example.comserver { listen 80; server_name example.com *.example.com 123.123.123.123; return 301 https://example.com$request_uri;}