nginx rewrite regular expression
巴扎黑
巴扎黑 2017-05-19 10:48:22
0
2
765
http://localhost/action
http://localhost/action/pre/xx/xx

All action interfaces are handled by tomcat, but in order to access the two URLs above at the same time, I configured the following two location segments. I always feel that this configuration method is not very elegant. I would like to ask if there is a better way. Appreciate it!

location ~ ^/(action)/?$ {
    proxy_pass  http://tomcats;
}

location ~ ^/(action)/(.+)$ {
    proxy_pass  http://tomcats;
}
巴扎黑
巴扎黑

reply all(2)
phpcn_u1646

Hello, may I ask what the original address of

thinkPHP3.2 message board video tutorial

is? I want to research it.

曾经蜡笔没有小新

Depend on your needs and requirements directly

location ^~ /action/{
    proxy_pass  http://tomcats;
}

That should be enough.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template