84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
Mein Programm ist zum Beispiel localhost:8080/demo/
Untertitelt in: localhost:9000/microsevice/demo, mit einem weiteren Microservice-Dienstnamen
可能理解错你的意思了。在用户浏览器URL里显示 localhost:8080/demo/,实际访问的是localhost:9000/microsevice/demo。
localhost:8080/demo/
localhost:9000/microsevice/demo
server { listen 8080; location ^~ / { # 如果需要的话 #proxy_set_header Host $host; #proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:9000/microsevice/; } }
在用户浏览器URL里显示localhost:9000/microsevice/demo,实际访问的是localhost:8080/demo/。
server { listen 9000; location ^~ /microsevice/ { # 如果需要的话 #proxy_set_header Host $host; #proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8080/; # 最后那个 / 是必须的。 } }
可以,用proxy_pass
可能理解错你的意思了。
在用户浏览器URL里显示
localhost:8080/demo/
,实际访问的是localhost:9000/microsevice/demo
。在用户浏览器URL里显示
localhost:9000/microsevice/demo
,实际访问的是localhost:8080/demo/
。可以,用proxy_pass