1、window服务器绑定了二个域名www.test.com,bbs.test.com. 现有2个tomcat发布项目分别是http://localhost,http://localhost:8081/project,
现在用nginx想实现www.test.com就访问http://localhost,bbs.test.com就访问http://localhost:8081/project.我用了nginx1.8配置,却一直不成功。
2、nginx.conf我是这样配置的:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.test.com;
location / {
proxy_pass http://localhost;
}
}
server {
listen 80;
server_name bbb.test.com;
location / {
proxy_pass http://localhost:8081/project;
}
}
}
是80端口被占用了。