Sha256: c72b3bf71fc4177705ae76ab01073e06f4727a93a8468caef75b96fb4a91417e
Contents?: true
Size: 1.71 KB
Versions: 6
Compression:
Stored size: 1.71 KB
Contents
upstream unicorn_<%= node[:application] %> { # This is the socket we configured in unicorn.rb server unix:<%= node[:shared_path] %>/sockets/unicorn.sock fail_timeout=0; } server { server_name <%= node[:railsapp][:server_names] %>; listen 80; root <%= node[:current_path] %>/public; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s; # If you don't find the filename in the static files # Then request it from the unicorn server if (!-f $request_filename) { proxy_pass http://unicorn_<%= node[:application] %>; break; } } location ~* \.(js|css|png|jpg|gif)$ { if ($query_string ~ "^[0-9]+$") { access_log off; expires max; add_header Cache-Control public; } } } <% if node[:railsapp][:ssl] %> server { listen 443; server_name <%= node[:railsapp][:server_names] %>; ssl on; ssl_protocols SSLv3 TLSv1; ssl_certificate <%= node[:current_path] %>/<%= node[:railsapp][:ssl_crt_path] %>; ssl_certificate_key <%= node[:current_path] %>/<%= node[:railsapp][:ssl_key_path] %>; proxy_set_header X-FORWARDED_PROTO https; root <%= node[:current_path] %>/public; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s; # If you don't find the filename in the static files # Then request it from the unicorn server if (!-f $request_filename) { proxy_pass http://unicorn_<%= node[:application] %>; break; } } } <% end %>
Version data entries
6 entries across 6 versions & 1 rubygems