SSL with Nginx and Play Framwork 2.2.x -
I am running my Play application on Amazon EC2 on port 9000. I have configured NGX as a reverse proxy long on port 443.
Here is my nginx configuration:
Proxy_buffering off; Proxy_set_header X-real-IP $ remote_adder; Proxy_set_header x-schema $ scheme; Proxy_set_header X-Forward- $ proxy_add_x_forwarded_for; Proxy_set_header host $ http_host; Proxy_ http_version 1.1; Upstreammy-app {server 127.0.0.1:9000; } Server {server_name www.my-app.com my-app.com; Rewrite ^ (. *) Https: //www.my-app.com $ 1 Permanent; } Server {443; Ssl on; Ssl_certificate /home/my-app.com/certificate.crt; Ssl_certificate_key /home/my-app.com/certificate.key; Keepalive_timeout 70; Server_name www.my-app.com; Location / {proxy_pass http: // my-app; }}
My question is: Do I need to launch my play app with HTTPS instead of HTTP or is it enough to set SSL at NGN level? Given the fact that I want to open all my pages via HTTPS.
Thank you.
You do not need to use a SSL connection between the proxy and the app, however in such cases Make sure the app port is not available from the world - most likely Amazon's security rules (or other providers / OSs).
Comments
Post a Comment