亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專欄INFORMATION COLUMN

NGINX 4xx 5xx 狀態(tài)碼構(gòu)造

jemygraw / 1004人閱讀

摘要:配置系列頭不合法頭重復(fù)參考如上配置訪問(wèn)需要認(rèn)證將設(shè)置為不可讀使用非方法訪問(wèn)一個(gè)靜態(tài)文件系列修改為缺少引號(hào)語(yǔ)法錯(cuò)誤的現(xiàn)在只支持如果客戶端隨意設(shè)置這個(gè)值會(huì)報(bào)修改配置為指向一個(gè)未監(jiān)聽(tīng)的端口

nginx配置
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       8070;
        server_name  10.96.79.14;
        limit_req zone=one;
        location / {
            root   html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location = /abc.html {
            root html;
            auth_basic           "opened site";
            auth_basic_user_file conf/htpasswd;
        }
         location ~ .php$ {
            root /home/xiaoju/nginx-1.14.0/html;
            fastcgi_index index.php;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param       SCRIPT_FILENAME  /home/xiaoju/nginx-1.14.0/html$fastcgi_script_name;
            include fastcgi.conf;
            fastcgi_connect_timeout 300;
            fastcgi_send_timeout 300;
            fastcgi_read_timeout 300;
        }
    }
}
index.php
 

4xx系列
400

NGX_HTTP_BAD_REQUEST

Host頭不合法
 
curl localhost:8070  -H "Host:123/com"



400 Bad Request

400 Bad Request


nginx/1.14.0
Content-Length頭重復(fù) curl localhost:8070 -H "Content-Length:1" -H "Content-Length:2" 400 Bad Request

400 Bad Request


nginx/1.14.0
401

NGX_HTTP_UNAUTHORIZED

參考如上nginx配置,訪問(wèn)abc.html需要認(rèn)證
 
curl localhost:8070/abc.html



401 Authorization Required

401 Authorization Required


nginx/1.14.0
403

NGX_HTTP_FORBIDDEN

chmod 222 index.html
將index.html設(shè)置為不可讀
 
curl localhost:8070



403 Forbidden

403 Forbidden


nginx/1.14.0
404

NGX_HTTP_NOT_FOUND

curl localhost:8070/cde.html



404 Not Found

404 Not Found


nginx/1.14.0
405

NGX_HTTP_NOT_ALLOWED

使用非GET/POST/HEAD方法訪問(wèn)一個(gè)靜態(tài)文件
curl -X DELETE localhost:8070/index.html -I


HTTP/1.1 405 Not Allowed
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 10:02:22 GMT
Content-Type: text/html
Content-Length: 173
Connection: keep-alive
5xx系列 500

NGX_HTTP_INTERNAL_SERVER_ERROR

修改index.php為


curl localhost:8070/index.php -I


HTTP/1.1 500 Internal Server Error
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 11:29:19 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=aoesvcuvbh1nh95kdkp152r9e1; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
501

NGX_HTTP_NOT_IMPLEMENTED

nginx的transfer-encoding現(xiàn)在只支持chunked,如果客戶端隨意設(shè)置這個(gè)值,會(huì)報(bào)501
 
curl localhost:8070  -H "Transfer-Encoding:1"



501 Not Implemented

501 Not Implemented


nginx/1.14.0
502

NGX_HTTP_BAD_GATEWAY

修改nginx配置為
fastcgi_pass 127.0.0.1:8000;


指向一個(gè)未監(jiān)聽(tīng)的端口
curl localhost:8070/index.php -I


HTTP/1.1 502 Bad Gateway
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 11:28:17 GMT
Content-Type: text/html
Content-Length: 537
Connection: keep-alive
ETag: "5ad6113c-219"
503

NGX_HTTP_SERVICE_UNAVAILABLE

修改nginx配置,限速為每分鐘10個(gè)請(qǐng)求
 
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/m;
limit_req zone=one;
連續(xù)發(fā)送兩個(gè)請(qǐng)求,第二請(qǐng)求會(huì)報(bào)503
curl localhost:8070/index.php -I

HTTP/1.1 503 Service Temporarily Unavailable
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 11:31:43 GMT
Content-Type: text/html
Content-Length: 537
Connection: keep-alive
ETag: "5ad6113c-219"
504

NGX_HTTP_GATEWAY_TIME_OUT

修改index.php為

curl localhost:8070/index.php -I

HTTP/1.1 504 Gateway Time-out
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 12:17:57 GMT
Content-Type: text/html
Content-Length: 537
Connection: keep-alive
ETag: "5ad6113c-219"
505

NGX_HTTP_VERSION_NOT_SUPPORTED

telnet8070端口,輸入GET /index.html HTTP/2.1
不支持http/2.1,會(huì)報(bào)505
 
$telnet localhost 8070
Trying 127.0.0.1...
Connected to localhost.
Escape character is "^]".
GET /index.html HTTP/2.1
HTTP/1.1 505 HTTP Version Not Supported
Server: nginx/1.14.0
Date: Tue, 18 Sep 2018 12:26:35 GMT
Content-Type: text/html
Content-Length: 203
Connection: close

505 HTTP Version Not Supported

505 HTTP Version Not Supported


nginx/1.14.0

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/40349.html

相關(guān)文章

  • Nginx實(shí)戰(zhàn)】構(gòu)建NGINX 4xx 5xx 狀態(tài)實(shí)例

    摘要:運(yùn)營(yíng)研發(fā)團(tuán)隊(duì)張仕華配置系列頭不合法頭重復(fù)參考如上配置訪問(wèn)需要認(rèn)證將設(shè)置為不可讀使用非方法訪問(wèn)一個(gè)靜態(tài)文件系列修改為缺少引號(hào)語(yǔ)法錯(cuò)誤的現(xiàn)在只支持如果客戶端隨意設(shè)置這個(gè)值會(huì)報(bào)修改配置為指向一 運(yùn)營(yíng)研發(fā)團(tuán)隊(duì) 張仕華 nginx配置 worker_processes 1; events { worker_connections 1024; } http { include...

    Lsnsh 評(píng)論0 收藏0
  • 2小時(shí)快速搭建后端接口報(bào)警系統(tǒng)(基于阿里云日志服務(wù)分析nginx訪問(wèn)日志)

    摘要:目標(biāo)后端任一接口一分鐘內(nèi)響應(yīng)超過(guò)一定的量,馬上收到報(bào)警提示報(bào)警及慢接口有詳細(xì)列表可以查看低成本。相關(guān)報(bào)警請(qǐng)求的詳細(xì)信息列表慢響應(yīng)分析 目標(biāo) 后端任一接口一分鐘內(nèi)5xx響應(yīng)超過(guò)一定的量,馬上收到報(bào)警提示 報(bào)警及慢接口有詳細(xì)列表可以查看 低成本。幾年前公司的日志報(bào)警系統(tǒng)是自研的,開(kāi)發(fā)成本比較高,也沒(méi)有達(dá)到阿里云日志服務(wù)這種產(chǎn)品化程度 機(jī)器部署情況 阿里云EC服務(wù)器 功能概述 阿里云日...

    lemanli 評(píng)論0 收藏0
  • 都得懂點(diǎn)http

    摘要:臨時(shí)性重定向該狀態(tài)碼表示請(qǐng)求的資源已被分配了新的,希望用戶本次請(qǐng)求能使用新的。該狀態(tài)碼表示發(fā)送的請(qǐng)求需要有通過(guò)認(rèn)證認(rèn)證認(rèn)證的認(rèn)證信息。該狀態(tài)碼表明服務(wù)器端在執(zhí)行請(qǐng)求時(shí)發(fā)生了錯(cuò)誤。 前言 最近在看nodejs,發(fā)現(xiàn)需要很多http相關(guān)的知識(shí),就去找了本「圖解HTTP」看,記錄下自己覺(jué)得比較重要的知識(shí)點(diǎn) URI格式 http:// user:passwd @www.cheesekun....

    ghnor 評(píng)論0 收藏0
  • 都得懂點(diǎn)http

    摘要:臨時(shí)性重定向該狀態(tài)碼表示請(qǐng)求的資源已被分配了新的,希望用戶本次請(qǐng)求能使用新的。該狀態(tài)碼表示發(fā)送的請(qǐng)求需要有通過(guò)認(rèn)證認(rèn)證認(rèn)證的認(rèn)證信息。該狀態(tài)碼表明服務(wù)器端在執(zhí)行請(qǐng)求時(shí)發(fā)生了錯(cuò)誤。 前言 最近在看nodejs,發(fā)現(xiàn)需要很多http相關(guān)的知識(shí),就去找了本「圖解HTTP」看,記錄下自己覺(jué)得比較重要的知識(shí)點(diǎn) URI格式 http:// user:passwd @www.cheesekun....

    hearaway 評(píng)論0 收藏0
  • 都得懂點(diǎn)http

    摘要:臨時(shí)性重定向該狀態(tài)碼表示請(qǐng)求的資源已被分配了新的,希望用戶本次請(qǐng)求能使用新的。該狀態(tài)碼表示發(fā)送的請(qǐng)求需要有通過(guò)認(rèn)證認(rèn)證認(rèn)證的認(rèn)證信息。該狀態(tài)碼表明服務(wù)器端在執(zhí)行請(qǐng)求時(shí)發(fā)生了錯(cuò)誤。 前言 最近在看nodejs,發(fā)現(xiàn)需要很多http相關(guān)的知識(shí),就去找了本「圖解HTTP」看,記錄下自己覺(jué)得比較重要的知識(shí)點(diǎn) URI格式 http:// user:passwd @www.cheesekun....

    bingchen 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<