###### nginx监听多个端口并转发给不同的服务
### 第一个监听:
upstream odoo {
server localhost:8067;
}
upstream odoochat{
server localhost:8072;
}
server {
listen 8070 default_server;
listen [::]:8070 default_server;

root /var/www/html;

# Add index.php to the list if you 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 8077 default_server;
listen [::]:8077 default_server;
server_name _;


location / {
proxy_pass http://odoo-qt;
}

}

 


懂得,原来世界如此简单!