server { listen 80 default_server; server_name localhost; location / { rewrite ^ http://www.xxx.com/?from-xxx; }}
Nginx将通过IP访问重定向
原文:http://www.cnblogs.com/xiaozong/p/5347398.html