Heim > Fragen und Antworten > Hauptteil
http://localhost/action
http://localhost/action/pre/xx/xx
Alle Aktionsschnittstellen werden von Tomcat verwaltet, aber um gleichzeitig auf die beiden oben genannten URLs zugreifen zu können, habe ich die folgenden beiden Standortsegmente konfiguriert. Ich habe immer das Gefühl, dass diese Konfigurationsmethode nicht sehr elegant ist ist ein besserer Weg. Es ist nicht ganz klar
location ~ ^/(action)/?$ {
proxy_pass http://tomcats;
}
location ~ ^/(action)/(.+)$ {
proxy_pass http://tomcats;
}
曾经蜡笔没有小新2017-05-19 10:50:22
看你的需要求,直接
location ^~ /action/{
proxy_pass http://tomcats;
}
应该就行了。