日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Nginx For Windows 路由配置

發布時間:2025/3/11 windows 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx For Windows 路由配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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/;}} }

總結

以上是生活随笔為你收集整理的Nginx For Windows 路由配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。