[play-2.6] lightppd proxy to https

Dear,

I’ve an application accessible via https://myhost.domain.it:8004 using the following directives:
-Dhttp.port=8011 -Dhttps.port=8004 -Dhttps.keyStore=keystore.jks

Now I would to register a new domain and enable lightppd to proxy to the 8004 port.

Following the Play documentation, I’m able only to proxy to the 8011 port using:

$HTTP["host"] =~ "myhost.domain.it" {
    proxy.balance = "round-robin" proxy.server = ( "/" =>
       ( ( "host" => "127.0.0.1", "port" => 8011 ) ) )
}

If I change the port 8011 to 8004, naturally it’s doesn’t work.
Which are the correct directives to proxy to 8004 HTTPS port?

I think to have solved:

$HTTP["host"] =~ "myhost.domain.it" {
    proxy.balance = "round-robin" proxy.server = ( "/" =>
       ( ( "host" => "127.0.0.1", "port" => 8004 ) ) )
        $SERVER["socket"] == ":443" {
        ssl.engine = "enable"
        ssl.pemfile = "/etc/lighttpd/chain.crt"
}
}
1 Like

Thanks for sharing your solution, @morellik. You may want to add this to our documentation here:

https://www.playframework.com/documentation/2.6.x/HTTPServer#Set-up-with-lighttpd

Best.

Ok, but at the end I switched to apache because proxying more than one SSL Play service with lighttpd I received 500 Internal Server Error without other useful information. I searched for a solution, but I didn’t find anything helpful.

Using apache I’ve a lot of options and at the end I’m able to proxy a lot of SSL services. If you want I can add the working apache configuration to the documentation.