Nginx設定及測試方法
先cd 到 nginx/conf 底下, 修改nginx.conf檔案
先設定一組自訂的upstream
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
然後設定server 80底下的location
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
然後設定server 443相關設定,server_name,location等
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
設定完後, cd到 sbin底下,
然後輸入 ./nginx -t 做測試
看到回應successful後
輸入 ./nginx -s reload 來重啟
最後用curl -v -k 輸入剛剛設定的網址來測試是否成功
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
因為DNS還沒設定,
所以我們可以先設定hosts或是用curl加參數來將網域名稱轉換為 IP 位址
參考網站-手動設定hosts
修改 /etc/hosts檔案
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
然後輸入 對應的IP 要轉換的網域
xxx.xxx.xxx.xxx abc.camiol.gov.tw
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
然後用curl -v -k 來呼叫網址測試看看
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
有回應資料,代表呼叫成功,nginx成功導向正確網址
參考網站-curl加參數來轉換
在curl後面加上參數
curl -v -k --resolve 要轉換的網域:port:要對應的ip 該呼叫網址
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
有回應資料,代表呼叫成功,nginx成功導向正確網址
其餘相關的設定
為了解決對方送來的request header太長的問題, 加入以下設定
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
tomcat 的sever.xml也要加上設定maxHttpHeaderSize
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →