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 · 2478 views
    This topic created in 616 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
        1
    caola  
       Sep 2, 2024
    error_page 403 /your_path/403.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1075 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 18:47 · PVG 02:47 · LAX 11:47 · JFK 14:47
    ♥ Do have faith in what you're doing.