Commits

Vladimir Mihailenco committed bf075eb

Add EC2 with load balance example

Comments (0)

Files changed (1)

fabdeploy/config_templates/nginx_gunicorn.config

-map $scheme $ssl {
+map $scheme $my_ssl {
     default off;
     https on;
 }
 
+# For AWS EC2 with load balancer please use:
+#
+# map $server_port $my_scheme {
+#     default http;
+#     443 https;
+# }
+#
+# map $server_port $my_ssl {
+#     default off;
+#     443 on;
+# }
+
 server {
     sendfile on;
     tcp_nopush on;
         proxy_set_header X-Real-IP         $remote_addr;
         proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
-        proxy_set_header X-Forwarded-Ssl   $ssl;
+        proxy_set_header X-Forwarded-Ssl   $my_ssl;
         proxy_redirect off;
     }