How to properly deploy the Vue history mode project in the root directory by Nginx

as described in the question

Let"s deploy Vue first. The key code is as follows

index.js under config

clipboard.png

main.js

clipboard.png

nginx

clipboard.png

500

clipboard.png

I want to deploy in the root directory, that is, I can directly enter the address to open the index home page. I don"t want to add a few more paths. The basic things on the Internet are not under the root directory. After I remove them, I seem to have a problem again, so I hope the boss can do me a favor and give me some advice

.
Jun.13,2022

you can start a service directly with a few lines of Node code, and you can rewrite index.html in history mode

.
Menu