Nginx 代理 WCF Tomcat

2018年8月22日 杂谈 0条评论 阅读次数 572

nginx 配置文件

upstream exsample_server_name {
    server WCForTOMCAT_server_ip : WCForTOMCAT_server_port;
}
#
server {
    listen 80 default_server;
    server_name $your_http_domain;
    location /path_name {
        proxy_pass         http://exsample_server_name/path_name;
        proxy_redirect     off;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   Host             $host:$server_port;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade          $http_upgrade;
        proxy_set_header   Connection       "upgrade";
    }
}

add_header Content-Type text/plain;