出現如圖所示錯誤,處理辦法如下
-
去nginx解壓目錄下執行
./configure --with-http_ssl_module
-
如果報錯 ./configure: error: SSL modules require the OpenSSL library.則執行
yum -y install openssl openssl-devel
./configure
./configure --with-http_ssl_module
-
執行
make
(切記不能 make install 會覆蓋安裝目錄) -
將原來 nginx 備份
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
-
將新的 nginx 覆蓋舊安裝目錄
cp objs/nginx /usr/local/nginx/sbin/nginx
-
如果報錯,執行
cp -rfp objs/nginx /usr/local/nginx/sbin/nginx
-
測試 nginx 是否正確
/usr/local/nginx/sbin/nginx -t
https://blog.csdn.net/weiyangdong/article/details/80008543
總結:
被netstat -anp 出來的內容欺騙了,規則是添加了,但是沒起效果。
如果返回404,403等等,那說明是nginx的配置等因素;
如果無法連接,通常是防火牆或者是雲服務(阿里雲/騰訊雲)的端口沒有放開,或者nginx爲啓動等可能的因素;
冷靜分析問題,查看錯誤信息,纔是解決問題的辦法,萬萬不能try stuff until it works,那樣只能是無用功。