nginx使用多端口监听多个服务

摘要:
######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; } }

免责声明:文章转载自《nginx使用多端口监听多个服务》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇测试开发-PC客户端测试要点IIS 之 应用程序池下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Nginx内存与磁盘资源的分配

本文介绍Nginx静态web服务器配置中的内存与磁盘资源的分配,即处理请求时,内存和磁盘资源的分配配置项。 1.HTTP包体保存在磁盘中 语法:client_body_in_file_only on|clean|off; 默认:client_body_in_file_only off; 配置块:server、http、location 当配置为off时,H...

[Linux] nginx记录多种响应时间

官网介绍$request_time – Full request time, starting when NGINX reads the first byte from the client and ending when NGINX sends the last byte of the response body$upstream_connect_tim...

交换机端口安全Port-Security超级详解

一、Port-Security概述   在部署园区网的时候,对于交换机,我们往往有如下几种特殊的需求: 限制交换机每个端口下接入主机的数量(MAC地址数量) 限定交换机端口下所连接的主机(根据IP或MAC地址进行过滤) 当出现违例时间的时候能够检测到,并可采取惩罚措施   上述需求,可通过交换机的Port-Security功能来实现:  ...

nginx 获取源IP 获取经过N层Nginx转发的访问来源真实IP

1. nginx 配置文件中获取源IP的配置项proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr; #一般的web服务器用这个 X-Real-IP 来获取源IPproxy_set_header x-forwarded-for $proxy_add_x_forwarded_f...

信息安全期末复习

一、米特尼克的圣诞攻击 1、攻击背景 在Unix世界中,可以很容易地给予信任。 假设用户在机器A和机器B上都有一个帐户,为了使两者之间的麻烦最小,就可以在它们之间建立全双工的信任关系。 在A的主目录中,创建一个 .rhosts 文件:echo "hostB 用户名" > .rhosts,在B的主目录中做同样的操作,现在,用户可以使用任何 r* 命令来...

windows10中docker nginx开启 但页面访问不了

Windows下对docker端口进行映射,但是当你在主机的浏览器中,打开localhost:port无法访问对应的服务。 docker是运行在Linux上的,在Windows中运行docker,实际上还是在Windows下先安装了一个Linux环境, 然后在这个系统中运行的docker。也就是说,服务中使用的localhost指的是这个Linux环境的地...