便宜VPS主机精选
提供服务器主机评测信息

nginx中请求如何反向代理到tomcat应用服务器上

nginx中请求如何反向代理到tomcat应用服务器上

将以下代码加到nginx网站对应的配置文件中:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 root /data/0/tomcat7/webapps/WechatSDK;   #将请求反向代理到tomcat应用服务器上了     location / {   index index.jsp index.html index.htm ;   proxy_redirect off; proxy_set_header Host $host ; proxy_set_header X-Real-IP $remote_addr ; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ; client_max_body_size 10m; client_body_buffer_size 128k; proxy_buffers 32 4k; proxy_connect_timeout 3; proxy_send_timeout 30; proxy_read_timeout 30; proxy_pass http: //127.0.0.1:8080; <code class=”php plain” style=”border: 0px !important; margin: 0px !important; padding: 0px !imp

 

未经允许不得转载:便宜VPS测评 » nginx中请求如何反向代理到tomcat应用服务器上