【发布时间】:2014-04-28 06:40:53
【问题描述】:
我使用的是this tutorial,但我指定的是应用程序目录,而不是普通的 server:port,但它给出了以下异常
nginx: [emerg] invalid host in upstream "localhost:9090/pa" in C:\app\abhishek\nginx_test\nginxc1/conf/nginx.conf:18
我使用 nginx 作为我的负载平衡和 tomcat 作为我的网络服务器。我可以使用http://localhost:9090/pa 和http://localhost:10080/pa 访问我的tomcat webapp。
这是我的 nginx.conf 文件
#user nobody;
worker_processes 1;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
#keepalive_timeout 0;
keepalive_timeout 75;
upstream balancer {
server localhost:9090/pa weight=2;
server localhost:10080/pa;
}
server {
listen 6789;
server_name localhost;
location /bal/ {
proxy_pass http://balancer;
}
error_page 500 502 503 504 404 /50x.html;
location = /50x.html {
root html;
}
}
}
【问题讨论】:
标签: tomcat nginx tomcat7 tomcat6