mysql数据库网站,wordpress 搜索 任意,dw做网站教程视频,wordpress 显示评论内容Nginx For Windows 路由配置一、路由配置说明二、需求说明三、配置文件一、路由配置说明
使用Nginx进行路由配置。
使用过 SpringCloud 网关的同学都知道#xff0c;网关可以使用同一IP地址、同一端口号、不同的服务ID#xff0c;转发不同服务API信息#xff0c;不会出现跨…
Nginx For Windows 路由配置一、路由配置说明二、需求说明三、配置文件一、路由配置说明
使用Nginx进行路由配置。
使用过 SpringCloud 网关的同学都知道网关可以使用同一IP地址、同一端口号、不同的服务ID转发不同服务API信息不会出现跨域的问题。
SpringCloud Gateway 的默认路由规则:http://Gateway_HOST:Gateway_PORT/大写的serviceId/xxx
如 http://192.168.1.1:8080/USER-API/ 转发到 http://192.168.1.200:9090/ http://192.168.1.1:8080/CAR-API/ 转发到 http://192.168.1.201:9092/ http://192.168.1.1:8080/ORDER-API/ 转发到 http://192.168.1.202:9094/
二、需求说明
监控本地服务器的 9000 端口根据不同的URL路径转发到不同的网络地址。
http://127.0.0.1:9000/t1/ 转发到 http://127.0.0.1:9001/ http://127.0.0.1:9000/t2/ 转发到 http://127.0.0.1:9002/ http://127.0.0.1:9000/baidu/ 转发到 https://www.baidu.com/
三、配置文件
完整配置文件如下测试可用 #user nobody;
worker_processes 1;#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;#pid logs/nginx.pid;events {worker_connections 1024000;
}http {server {listen 9000;server_name localhost;location /t1/ {proxy_pass http://127.0.0.1:9001/;}location /t2/ {proxy_pass http://127.0.0.1:9002/;}location /baidu/ {proxy_pass https://www.baidu.com/;}}
}