proxy_set_header Host "dujia.qunar.com"; proxy_set_header X-Real-IP$remote_addr; proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for; proxy_set_header dj-sch "https"; proxy_set_header X-Real-Scheme $scheme; location / { proxy_pass http://127.0.0.1:80; #proxy_pass http://p.tuan.qunar.com; } }在java中通过X-Real-Scheme或dj-sch获取当前协议
- private static String HTTPS_HEADER = "X-Real-Scheme";
- private static String HTTPS_SCHEME = "https";
- private static String HTTP_SCHEME = "http";
- public static String getScheme(HttpServletRequest request){
更多相关内容: