In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge points about how to solve the 403 problems caused by nginx configuration. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Solutions to the 403 problems caused by nginx configuration
1. Problem: 403 occurs when the local domain name is configured by curl nginx
The nginx_error.log log is as follows:
Second, doubt
1. Www.requesturi.com is configured as follows: it is found that the root directory is inconsistent with the prohibited files in the error log. Theoretically, access to www.requesturi.com should be looked up at / usr/local/nginx/html1. Why does it show that access is indeed prohibited by / usr/local/nginx/html?
2. An a.txt file under curl / usr/local/nginx/html1 found that the error turned out to be 404.
Third, solve the problem
It can be roughly inferred that www.requesturi.com may not be configured in nginx.conf. Check nginx.conf and find that www.requesturi.com is not configured and nginx is not allowed to access the directory of the file by default, so there will be an error of 403.
Take a look at the configured www.zhuye.com and find that the root directory of www.zhuye.com is the same as the forbidden directory in the error log, and server_name is an ip rather than a domain name
Reason: because www.requesturi.com is not configured, when we access www.requesturi.com, nginx accesses the default (that is, www.zhuye.com) and reports an error that 404 cannot find when accessing a.txt (this file does not exist in the www.zhuye.com directory).
You can modify the nginx configuration so that nginx can access the file directory:
Display the files in the directory:
These are all the contents of this article entitled "how to solve the 403 problems caused by nginx configuration". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.