Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx solves the method of VUE redirect refresh pointing to the home page

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "nginx to solve the problem of VUE redirect refresh pointing to the home page". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

When a user requests http://localhost/example, the $uri here is / example. Try_files will try to find this file on the hard drive. If there is a file named / $root/example (where $root is the project code installation directory), send the contents of the file directly to the user. Obviously, there is no file called example in the directory. Then look at $uri/, to add a /, that is, to see if there is a directory called / $root/example/. If it is not found, it will fall back to / index.php, the last option of try_files, and initiate an internal "sub-request", which is equivalent to nginx initiating a HTTP request to http://localhost/index.php.

`server {listen 808; # server_name rc.huanwei.tidecloud.com

Root / var/www/html; index login.html index.htm; # rewrite / index.html / login permanent; location / {try_files $uri $uri/ [@ router] (https://my.oschina.net/u/2258684); index index.html;} location [@ router] (https://my.oschina.net/u/2258684) {rewrite ^. * $/ index.html last) } location ~. *\. (gif | jpg | jpeg | png | bmp | swf | js | css | html) ${root / var/www/html/rc.huanwei.tidecloud.com;} location / api-customer {proxy_pass http://192.168.0.110:13200;}

}

This is the end of the content of "nginx solution to VUE redirect refresh pointing to the home page". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report