Reputation: 6669
I was wondering to emulate the prod enviorment in the local network.
My first goal is to set up HTTPS. I was wondering if I can do with a self-signed cert on the local network.
Which would be the best way? I have no idea at all.
Thank you
Upvotes: 1
Views: 107
Reputation: 55798
The easiest way to run Play with self generated and self signed certificate is to add -Dhttps.port
param to run command, optionally you can also disable non-SSL trafic by using
-Dhttp.port=disabled
flag, finally if you want to run the app on default 443 port you need to sudo
in any unix system it will look like:
sudo ./activator -Dhttp.port=disabled -Dhttps.port=443 run
Other approach known especially from first releases of Play 2.x is generating own keys and configuring some HTTP server as reverse proxy with their usage, anyway for testing it's not necessary anymore.
Both approaches are described in docs: using built-in SSL support and also reverse proxy (with nginx sample config)
Upvotes: 2