會使用Ngix為配合公司資安政策,內部系統不能直接發查外部API,因此在DMZ區建立跳板 當然Nginx的強大也不只是做代理(Proxy), ### Step 1 Nginx環境設定 Windows版下載 http://nginx.org/en/docs/windows.html 載入後放置server上 隨便找一個你爽的地方放 範例 ⇾ C:\Users\Administrator\Desktop\nginx-1.25.3 接下來 打開Cmd (以系統管理員身分執行) ![image](https://hackmd.io/_uploads/BJ4mKTfPp.png) 移動到資料夾下 ```C! Cd C:\Users\Administrator\Desktop\nginx-1.25.3\conf ``` 執行nginx,此時會有視窗閃一下 ```C! start nginx ``` 接下來確認是否運行 ```C! tasklist /fi "imagename eq nginx.exe" ``` 可以看到以下結果,代表已順利啟動 ![image](https://hackmd.io/_uploads/rkCYN0zw6.png) ### step2 設定轉導 \nginx-1.25.3\conf 打開nginx.conf 所有轉導相關都在這裡設定 ![image](https://hackmd.io/_uploads/HkXsLAfPa.png) ```C! server { listen 8008; //監聽Port location / { proxy_pass http://10.20.231.235:8008; } //轉導目的地 } ``` 設定完之後,重新載入config ```C! nginx -s reload ``` 這樣就可以完成初步的轉導囉! 其他的下次再說 掰餔