Salta 发表于 2022-4-21 20:34
那你直接 return 404; 看看行不行?
zxjlhsq 发表于 2022-4-21 20:39
直接404 和 403 效果一样 是默认的nginx页面 我想弄个自定义的404.html
Waylon 发表于 2022-4-21 22:17
if ($http_user_agent ~* "QQBrowser") {
rewrite ^/(.*)$ /404.html break;
}
tiga 发表于 2022-4-21 21:35
改 error_page 不就行了
Waylon 发表于 2022-4-21 22:17
if ($http_user_agent ~* "QQBrowser") {
rewrite ^/(.*)$ /404.html break;
}
叼爆小朋友 发表于 2022-4-22 09:36
404错误页面放到404文件夹里面,if语句写到location反代里面。return后面加上404页面的绝对地址,return ht ...
柒焰 发表于 2022-4-22 09:38
用error_page就可以了,要不然就让指定来路的重定向到你写的404页
coolloves 发表于 2022-4-22 10:48
首先,nginx.conf主配文件需要开启 proxy_intercept_errors on;
然后 error_page 404 /your404.html;
所有4 ...
coolloves 发表于 2022-4-22 10:48
首先,nginx.conf主配文件需要开启 proxy_intercept_errors on;
然后 error_page 404 /your404.html;
所有4 ...
zxjlhsq 发表于 2022-4-22 11:18
试了一下 如果不用 pass 反代 是成功的。 但如果加了 pass 反代后 打开 直接提示 下载文件
下载的 ...
zxxx 发表于 2022-4-22 11:21
add_header 'Content-Type' 'text/html;charset=utf-8';
Return ....
zxxx 发表于 2022-4-22 11:21
add_header 'Content-Type' 'text/html;charset=utf-8';
Return ....
Cllp 发表于 2022-4-22 11:43
if ($http_user_agent ~* "密码") {
;
zxxx 发表于 2022-4-22 11:21
add_header 'Content-Type' 'text/html;charset=utf-8';
Return ....
欢迎光临 全球主机交流论坛 (https://91ai.net/) | Powered by Discuz! X3.4 |