Nginx does not forward the request to Tomcat's port? What to do!

Alibaba cloud Q & A 2022-02-13 07:55:46 阅读数:735

nginx forward request tomcat port

I am here /var/build/ There is a front-end project under the directory , Give Way nginx The front page opens by default , Then I want to forward the request to... When the front end sends the request tomcat Handle From the exception log, there is no access localhost:8080/auth/api/dologin

It is localhost:80/auth/api/dologin (/var/build/auth/api/dologin)

This is my configuration : image.png

Take the answer 1:

Hello! , Grammar of the last two paragraphs location In the wrong ,location The default is prefix matching , and normalized URI The first character is obviously /, So it should be written roughly like this location /auth{...}, Please test whether to forward after modification .

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you.