{{#SSL_ENABLED}} server { listen 8080; location /elb-health-check { access_log off; return 200; } return 301 https://$host$request_uri; } {{/SSL_ENABLED}} server { {{^SSL_ENABLED}} listen 8080; {{/SSL_ENABLED}} {{#SSL_ENABLED}} listen 8433 ssl spdy; ssl_certificate {{{NGINX_SSL_CERTIFICATE}}}; ssl_certificate_key {{{NGINX_SSL_CERTIFICATE_KEY}}}; {{#SSL_STRICT}} add_header Strict-Transport-Security max-age=31536000; {{/SSL_STRICT}} ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:AES256-GCM-SHA384:AES256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; {{/SSL_ENABLED}} server_name {{{NGINX_SERVER_NAME}}}; error_page 502 /errors/502.html; {{^SSL_ENABLED}} location /elb-health-check { access_log off; return 200; } {{/SSL_ENABLED}} location ~ ^/(img/|js/|css/|views/|robots.txt|humans.txt|favicon.ico) { root {{{SRV_CURRENT}}}/{{{NGINX_STATIC_ROOT}}}; access_log off; expires max; } location /errors { internal; alias {{{SRV_CURRENT}}}/{{{NGINX_STATIC_ERRORS}}}; } location / { proxy_redirect off; proxy_set_header Connection ""; proxy_set_header Host $http_host; 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_http_version 1.1; proxy_cache one; proxy_cache_key nx$request_uri$scheme; proxy_pass http://127.0.0.1:{{{NGINX_PROXY_PORT}}}; } }