Nginx簡單的代理配置

核心配置代碼

找到Nginx的配置文件nginx.conf,修改配置,主要添加了proxy_pass參數。

#將請求"http:127.0.0.1:80/helloworld" 轉向服務器 "http://127.0.0.1:8081"
server {
        listen       80;
        server_name  127.0.0.1;

        location /helloworld {
             proxy_pass     http://127.0.0.1:8081; # 表明了所代理的服務器
 }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章