- 论坛徽章:
- 0
|
本帖最后由 journeyto0405 于 2014-02-15 14:49 编辑
小弟有2台服务器,分别为49.49、49.50,49上安装了nginx,50上安装有tomcat(开放端口为8080),webapps下面有一个工程MailSystem。
原本意图是通过访问49.49/MailSystem/,就把请求转发到50上的tomcat进行处理,
现在nginx配置如下:
user nobody;
worker_processes 4;
worker_cpu_affinity 00000001 00000010 00000100 00001000;
events {
use epoll;
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr,$server_addr,$document_uri,[$time_local],$request_time';
sendfile on;
keepalive_timeout 65;
upstream backend{
server 192.168.49.50:8080 ;
jvm_route $cookie_JSESSIONID|sessionid reverse;
}
server {
listen 80;
server_name localhost;
location /Nginx_status {
stub_status on;
access_log on;
}
location / {
root html;
index index.html index.htm;
}
location /MailSystem/
{
proxy_pass http://backend;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
主要配置部分就是上面红色部分,但是通过浏览器访问49.49/MailSystem/, 就是没有任何反应,也没有任何报错,也没有跳转到50上的tomcat上,请教下是什么原因呢? |
|