Play2 : Support for Server Name Indication

故事扮演 提交于 2019-12-10 11:49:22

问题


Does Play2.0.x support Server Name Indication?

A pointer to docs or examples would be great.

I have the typical use case: I want to use name-based virtual hosting of "unrelated" Play2 appservers behind a shared load-balancer, doing SSL termination at the individual appservers.


回答1:


Java 7 now supports SNI, but only on the client-side. This will be a problem if you want to to handle the connections directly from Java.

However, being behind a load-balancer should help you. If it can handle SNI (which is the case for modern versions of Apache Httpd, for example), you could reverse proxy to a server listening on different ports for each of the host names you want to use.

  • www.domain1.example ---reverse proxy---> 192.168.0.10:8080 (configured for application www.domain1.example)
  • www.domain2.example ---reverse proxy---> 192.168.0.10:8081 (configured for application www.domain2.example)

You'd have to let the load-balancer handle the SSL connection. Alternatively, if the load-balancer is sufficiently clever to dispatch to a different port after looking at the server name extension in the Client Hello initial TLS message, it might be able to do it this way (I'm not sure if any can).



来源:https://stackoverflow.com/questions/11574216/play2-support-for-server-name-indication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!