Play! framework: HTTPS and HTTP simultaneously

I added https.port to my application.conf to get HTTPS support. The problem is that one of my routes must be accessible via HTTP, because the client does not support HTTPS. Is it possible to do this without having to disable HTTPS for the entire site.

Thanks.

Edit:

My route file is pretty standard and has not changed since I switched to HTTPS. The problem is when I want to connect to the HTTP port, the connection time does not work.

+4
source share
2 answers

You just need to have both http.port and https.port in the application.conf file. For links that you want to distinguish from a regular site, use the @@ note:

@@{Controller.action().secure()} => https://...

@@ {Controller.action ()} => http: //

+7
source

I am using 2.0.

In my case @routes.Application.authenticate().absoluteURL(secure = true) = true) generates https prefixed url, thinking that it does not work, because I do not yet fully configure it.

In prod, I still plan on using a reverse proxy.

0
source

All Articles