摘要:######nginx监听多个端口并转发给不同的服务###第一个监听:upstreamodoo{serverlocalhost:8067;}upstreamodoochat{serverlocalhost:8072;}server{listen8070default_server;listen[::]:8070default_server;root/var/www/html;#Addindex.p
###### nginx监听多个端口并转发给不同的服务
### 第一个监听:
upstream odoo {
server localhost:8067;
}
upstream odoochat{
server localhost:8072;
}
server {
listen 8070default_server;
listen [::]:8070default_server;
root /var/www/html;
# Add index.php to the list ifyou are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location /{
proxy_pass http://odoo;
# index index.html;
}
location /longpolling{
proxy_pass http://odoochat;
}
#### 这是第二个监听
upstream odoo-qt {
server localhost:8069;
}
server{
listen 8077default_server;
listen [::]:8077default_server;
server_name _;
location /{
proxy_pass http://odoo-qt;
}
}