Reference "tomcat start distal Project": https://www.cnblogs.com/mySummer/p/11167224.html configure the front access context items: follows:
After configuration is complete, hit dist package:
Then configure nginx:
. 1 Server { 2 the listen 8089 ; . 3 server_name localhost; . 4 . 5 LOCATION / testTom / apis / { // If the background is a distal access / apis / background access path is configured here: / apis /. If the background is the front-end access / testTom / apis /, is here with: / testTom / apis /
// Proxy Result: the browser ip: port plus behind the location of this configuration value ==== "replaced ===" the value proxy_pass . 6 proxy_pass HTTP: // localhost: 8088 / background-path project context /; . 7 } . 8 . 9 LOCATION / { // At this visit ip: port / testTome / access to the project root 10 the root D: \ XXX \ Front; . 11 } 12 is 13 }
effect:
Front-end ip: port / testTom / # / front-end path, for example: localhost: 8089 / testTom / # / shouye access vue Home
Distal ip: port / testTom / apis / background particular access path controller, such as: localhost: 8089 / testTom / apis / testCon / testQuery. This is equivalent to the access === Background ip: port / background project context / background particular access path controller, such as: localhost: 8080 / studydemo / testCon / testQuery