Ask how to configure multiple vue projects with nginx

if the question assumes that the domain name test.com
the first project is configured in test.com,
background configuration in test.com/admin
both are vue projects,
what should I do

I will configure the project in the first root directory. How should I configure the second one

Sep.06,2021

nginx can only be configured according to the domain name. You want to control the following directory, another conceptual meaning of the domain name.
it is recommended that nginx be assigned a subdomain name to the backend project ok, such as admin.test.com.
suggest adopting the answer, thank you!


find the webpack configuration file in the vue project to add a directory path to the project packaging. The default configuration is packaged into the dist folder, and you can customize the packaging to dist/demo. So every time you visit the project, you have demo as a prefix, such as http://localhost/demo/index.html, and then put it in Nginx

.
Menu