自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

開發(fā) 前端
Nginx 502錯(cuò)誤是我們最常見的一個(gè)問題,我們需要不斷的學(xué)習(xí)有關(guān)知識(shí)。下面我們就來詳細(xì)的學(xué)習(xí)有關(guān)的問題如何才能解決。

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

方法一:在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' 

方法二:?jiǎn)?**建一個(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 

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

【編輯推薦】

  1. nginx配置虛擬主機(jī)具體的代碼配置
  2. nginx默認(rèn)虛擬主機(jī)如何在server中添加
  3. nginx負(fù)載均衡如何進(jìn)行配置
  4. nginx配置文件經(jīng)典教程分析
  5. nginx配置文件實(shí)現(xiàn)AWStats靜態(tài)頁(yè)面
責(zé)任編輯:張浩 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-09-30 14:35:36

JS浮點(diǎn)溢出

2009-11-16 09:45:51

PHP上傳文件大小

2009-11-16 13:46:28

PHP上傳文件大小限制

2010-06-07 17:41:42

Sendmail 配置

2010-10-09 16:04:22

J2ME代碼優(yōu)化

2010-03-29 17:46:39

Nginx asp

2010-05-19 15:42:08

2010-03-24 18:19:42

Nginx php

2009-11-11 16:36:19

路由協(xié)議介紹

2009-10-27 09:49:38

無(wú)線接入技術(shù)

2019-05-15 10:59:50

開發(fā)者技能工具

2009-12-07 13:42:24

WCF框架

2010-05-26 18:20:59

SVN庫(kù)

2009-10-28 10:34:12

2009-12-29 16:07:19

ADO類型

2009-10-15 10:29:03

布線系統(tǒng)解決方案

2018-06-04 09:43:53

分層存儲(chǔ)Linux

2010-11-17 09:48:07

Nginx 502錯(cuò)誤

2010-01-06 16:53:57

JS兩種語(yǔ)法

2010-02-01 10:22:51

C++數(shù)據(jù)指針
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)