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)06/02 Report--
This article introduces the relevant knowledge of "what are the common problems of Nginx". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
NGINX does not allow POST requests to static files, otherwise 405 error telnet *.*. *.* 80POST /map/navigation/2011winter/jsn/jsn_20120723_pack/pvf.jsnHTTP/1.1Host:*.*.*.* HTTP/1.1 405 Not Allowed MapbarServer: MapbarServerDate: Mon, 08 Oct 2012 05:34:53 GMTContent-Type: text/htmlContent-Length: 173Connection: keep-alive405 Not Allowed405 Not Allowed MapbarServer After checking, it is found that NGINX does not allow POST requests to static files, otherwise 405 errors will be reported. Solution: 1. Add the following error_page 405 = 200@405 to the nginx vhosts configuration file. location @405 { root /mapdata/www/datamobile/; proxy_method GET; proxy_pass http://map_tomcat; The project uses yaf and vue for front and back separation, and the page is normal when visiting. But refresh will report error. Sometimes you don't even get a page requested.
In this case, the main use of vue before and after the separation of the front end has a separate index.html under public
All their pages are stored in this index.html. This means that all page requests must be made to this file.
So if we request a page through a traditional URL like login,/user/login, we get an error that the page doesn't exist.
When our project is deployed, all WEB and APP interfaces are separately created in Module.
So our interface request, must have the word web or app, so we modify NGINX configuration file.
Prioritize matching URLs with apps or web, reset them to public/index.php for yaf processing
The requested URL/index.html was not found on this server.
server { listen 80; server_name otc.coinegg.im; access_log /home/work/logs/nginx/otc.coinegg.im.access.log main; error_log /home/work/logs/nginx/otc.coinegg.im.error.log; root /home/work/www/otc/public; #Prohibiting requests for git related hidden files, this should also be put in front, as long as it is before location / location ~ /.git/ { deny all; } #This is to be put in front, do regular matching, match to URL containing WEB or APP, redirect to index.php according to YAF location [/web/|/app/] { root /home/work/www/otc/public; #Do not redefine root here unless the path is different index index.php; if (!- e $request_filename) { rewrite ^/(.*)$ /index.php?$ 1 last; } } #This comes later, when all requests are redirected to index.html. location / { root /home/work/www/otc/public; #Do not redefine root here unless the path is different index index.html; try_files $uri $uri/ /index.html; } #This is for FPM, just keep it the same location ~ \.php$ { index index.php; fastcgi_pass unix:/tmp/unix/php-cgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}make -j2 error, I have this error under ubuntu18.04 # make -j2 if error:objs/Makefile:591: recipe for target 'objs/src/core/ngx_murhash.o' failed#I have this error under ubuntu18.04 #Remove-Werror in objs/Makefile For warnings ignore # vim objs/Makefile find CFLAGS = -I/usr/local/luajit/include/luajit-2.0 -pipe -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g -DNDK_SET_VAR#delete-Werrori "What are the Nginx FAQs?"The content is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
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.