› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
dunhanson
V2EX  ›  NGINX

nginx if 语句 return 403,没办法跳转自定义 403 页面

  •  
  •   dunhanson · Sep 2, 2024 · 2951 views
    This topic created in 795 days ago, the information mentioned may be changed or developed.

    nginx if 语句 return 403 ,没办法跳转自定义 403 页面

    返回的 403 还是 nginx 自带的 403 页面

    error_page 403 /403.html;
    location = /403.html {
    	root D:/program/nginx/nginx-1.18.0/html;
    }
    
    if ($http_user_agent ~ "Baiduspider") {
    	return 403;
    }
    
    1 replies  •  2024-09-02 18:20:24 +08:00
    caola
    caola
    Sep 2, 2024
    1
    error_page 403 /your_path/403.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1870 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:34 · PVG 09:34 · LAX 17:34 · JFK 20:34
    ♥ Do have faith in what you're doing.