You are viewing an historical archive of past issues. Please
report new issues to the appropriate project issue tracker on
GitHub.
Comments
-
Greg Hurrell
It was a mistake in the config file (specifically, we were rewriting to
$1$index_filename
instead of$1$index_filename$cache_extension
in one place). The relevant section of the config file now looks like this:# rewrite all requests to *.example.com back to example.com if ($host != example.com) { rewrite ^(.*) https://example.com$1 permanent; } # serve static content without hitting Rails # this also bypasses our maintenance page check location ~ /(images|javascripts|stylesheets)/ { expires 72h; } location /system/maintenance.html { # always allow access to this file; explained here: # http://www.ruby-forum.com/topic/141251 } location / { if (-f $document_root/system/maintenance.html) { error_page 503 /system/maintenance.html; return 503; } # cached pages: only for GET requests set $cache_extension ''; if ($request_method = GET) { set $cache_extension '.html'; } if (-f $request_filename) { break; } set $index_filename 'index'; if (-f $request_filename$index_filename$cache_extension) { # URI has trailing slash rewrite (.*) $1$index_filename$cache_extension break; } if (-f $request_filename/$index_filename$cache_extension) { # URI has no trailing slash rewrite (.*) $1/ permanent; } if (-f $request_filename$cache_extension) { rewrite (.*) $1.html break; } if (-f $static_root$uri) { root $static_root; break; } if (-f $static_root${uri}index.html) { # URI has trailing slash root $static_root; rewrite (.*) $1$index_filename$cache_extension break; } if (-f $static_root$uri/index.html) { # URI has no trailing slash rewrite (.*) $1/ permanent; } proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X_FORWARDED_PROTO https; proxy_max_temp_file_size 0; if (!-f $request_filename) { proxy_pass http://unicorn; break; } }
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.