我想为grails中的sub.mysite.com sub2.mysite.com等子域实现Url映射。 现在最好的解决方案是通过nginx / lighttpd进行一些重写。 但是有可能通过原生Grails Url映射功能吗?
I want to implement Url mapping for subdomains like sub.mysite.com sub2.mysite.com in grails. The best solution for now is to do some rewriting via nginx/lighttpd. But is it possible via native grails Url mapping features ?
最满意答案
UrlMappings不适用于Web服务器中的完整URL重写。 UM仅用于“服务器URL”(应用程序根目录)之后的URL部分。 如果Web服务器中的重写规则对您来说不够,您还可以实现自己的过滤器并将其注册到web.xml,但是您的帖子没有提供足够的信息来决定;-)
UrlMappings are not meant for full URL rewrite like in web server. The UM are only for the the part of URL after "server URL" (application root). If the rewrite rules in web server are not sufficient for you, you can also implement your own filter and register it to the web.xml, but your post does not provide enough information to decide ;-)
更多推荐
发布评论