av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Nginx502錯(cuò)誤兩種解決方案介紹

我們在使用Nginx的時(shí)候有不少問題出現(xiàn),首先我們就來解決下Nginx 502錯(cuò)誤的問題。定義Nginx 404 502錯(cuò)誤提示頁面,直接配置Nginx 502錯(cuò)誤,找了很多資料,最終沒能實(shí)現(xiàn)。下面用另一個(gè)方法實(shí)現(xiàn).

創(chuàng)新互聯(lián)公司是工信部頒發(fā)資質(zhì)IDC服務(wù)器商,為用戶提供優(yōu)質(zhì)的服務(wù)器托管服務(wù)

方法一:在Nginx.conf配置文件里加上以下紅色代碼

 
 
 
  1. erver   
  2. {   
  3. listen 80;   
  4. server_name www.tt.com;   
  5. location / {   
  6. proxy_pass http://week;   
  7. proxy_set_header Host $host;   
  8. proxy_set_header X-Real-IP $remote_addr;   
  9. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;   
  10. if (!-f $request_filename) {   
  11. proxy_pass http://127.0.0.1:8888;   
  12. }   

17.0.0.1:8888配置如下

 
 
 
  1. erver   
  2. {   
  3. listen 8888;   
  4. server_name www.tt.com;   
  5. location / {   
  6. root /root;   
  7. index index.html;   
  8. error_page 500 502 404 /404.html;   
  9. }   

需要維護(hù)的時(shí)候,只需要重啟Nginx服務(wù)。

 
 
 
  1. kill -HUP 'cat logs/  nginx  .pid' 

方法二:單***建一個(gè)testnginx.conf文件

 
 
 
  1. #user nobody;   
  2. worker_processes 1;   
  3. pid logs/nginx.pid;   
  4. events {   
  5. use epoll;   
  6. worker_connections 50000;   
  7. }   
  8. http {   
  9. include mime.types;   
  10. default_type application/octet-stream;   
  11. sendfile on;   
  12. server   
  13. {   
  14. listen 80;   
  15. server_name www.tt.com;   
  16. location / {   
  17. root /root;   
  18. index index.html;   
  19. error_page 500 502 404 /404.html;   
  20. }   
  21. }   
  22. }  

維護(hù)時(shí)只需把Nginx 502錯(cuò)誤停止,從新啟用新的配置文件

 
 
 
  1. killall -9 nginx   
  2. nginx -c ../conf/testnginx.conf 

以上就是對Nginx 502錯(cuò)誤的詳細(xì)介紹希望大家有所幫助。


當(dāng)前標(biāo)題:Nginx502錯(cuò)誤兩種解決方案介紹
鏈接URL:http://uogjgqi.cn/article/ccsgshi.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們在微信上24小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流