当前位置:网站首页>WDCP访问不存在的路径全部跳转到首页不返回404的解决办法
WDCP访问不存在的路径全部跳转到首页不返回404的解决办法
2022-06-29 06:32:00 【冰冷的希望】
以前都没有注意到,使用wdcp面板,nginx引擎,如果访问一个不存在的url它不会返回404,而是自动返回首页,感觉有点坑,所以我们还是要自定义一个404页面的
先把准备好的404.html文件上传到服务器,记录pwd查看绝对路径,然后编辑nginx的配置文件,路径是
vi /www/wdlinux/nginx-1.16.1/conf/vhos/00000.default.conf
配置文件的扩展名是.conf,上面的路径的nginx版本和conf文件名根据自己的实际情况改变,因为我安装的是1.16.1版本的nginx,所以文件夹命名是nginx-1.16.1
server {
listen 80;
root /www/web/default;
...
location ^~ /icy_pocket/ {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
}
location ^~ /website/ {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
}
# 自定义404页面
location = /404.html {
# 把上传的404.html文件路径填写到这
root /www/web/default;
}
...
location / {
# 注释掉这行代码
#try_files $uri $uri/ /?$args;
}
}
保存之后记得重启nginx
/www/wdlinux/nginx-1.16.1/sbin/nginx -t
/www/wdlinux/nginx-1.16.1/sbin/nginx -s reload
边栏推荐
- Stack -- 739 Daily temperature
- Week 10 - task 1- fill in the blank: line class inherits point class
- 配置Flutter开发环境
- Jenkins operation Chapter 6 mail server sending build results
- 64 commonly used terms for data analysis, really all!
- 目标检测——使用yolov6进行视频推理
- Antlr4 recognizes the format of escape string containing quotation marks
- Servlet version conflict causes page 404
- There are two ways for golang to develop mobile applications
- Rich material libraries make modeling easy and efficient for developers
猜你喜欢

What is MES? What does it do?

MySQL learning notes

Rich material libraries make modeling easy and efficient for developers

Maximum ascending subarray sum of leetcode simple problem

Will the order of where conditions in MySQL affect the union index? Will where 1 =1 affect the use of the index? Does where 1 =1 affect the use of indexes?
![ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience](/img/fd/4c24e10fc91a7ce7e709a0874ba675.jpg)
ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience

Leetcode simple problem building arrays with stack operation
![ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience](/img/fd/4c24e10fc91a7ce7e709a0874ba675.jpg)
ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience

RedisTemplate处理hash整数类型的问题解析

Yyds dry goods inventory meituan's two-sided experience, and finally there was a surprise?
随机推荐
[C language series] - branch and loop statements
JDBC | Chapter 6: simple use of database connection pool
[high concurrency] deeply analyze the callable interface
Programming specification and variables of shell script
Is there any difference between a=a+b and a+=b?
Devops development, operation and maintenance Basics: using Jenkins to automatically build projects and notify by email
Problems with MySQL database query
Honeypot based on MySQL load data local INFILE
Linux Installation redis
Why is there a packaging type?
MySQL learning notes
Venn diagram proportional and color shading with semi transparency
Go compile source code (window environment)
Browser local storage
Alphacode made its debut! The programming version of "Alpha dog" competed quietly and defeated half of the programmers
Can redis implement hot standby?
Awk of shell script
What is the "danksharding" of V God Kop on Valentine's day?
flutter配置国内镜像,连接真机
Antd work item memo w3.0