lib/capistrano/templates/nginx_conf.erb in capistrano3-puma-3.1.1 vs lib/capistrano/templates/nginx_conf.erb in capistrano3-puma-4.0.0
- old
+ new
@@ -44,18 +44,23 @@
error_page 500 502 504 /500.html;
error_page 503 @503;
location @puma_<%= fetch(:nginx_config_name) %> {
+ proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
<% if fetch(:nginx_use_ssl) -%>
proxy_set_header X-Forwarded-Proto https;
<% else -%>
+ <% if fetch(:nginx_downstream_uses_ssl) -%>
+ proxy_set_header X-Forwarded-Proto https;
+ <% else -%>
proxy_set_header X-Forwarded-Proto http;
+ <% end -%>
<% end -%>
proxy_pass http://puma_<%= fetch(:nginx_config_name) %>;
# limit_req zone=one;
access_log <%= shared_path %>/log/nginx.access.log;
error_log <%= shared_path %>/log/nginx.error.log;