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

How does nginx deploy projects built to access vue-cli

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how nginx deploys and accesses projects built by vue-cli". Xiaobian shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how nginx deploys and accesses projects built by vue-cli" can help you solve the problem.

This is done as follows:

1. Create a background server object

upstream mixVueServer{ server baidu.com;#here is your server domain name}

2. Create access port and reverse proxy rules

server { listen 8082; server_name localhost; location / { root E:/mix_vue/dist;#Navigate to project directory #index index.html index.htm; try_files $uri $uri//index. html;#Configure according to the rules of the official website } location ~ \.php${ proxy_pass http://mixVueServer;#Do reverse proxy according to backend language to handle cross-domain problems proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }

Finally, direct address bar input port access:

The content of "How to deploy nginx to access vue-cli built projects" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.

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

Internet Technology

Wechat

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

12
Report