I deployed the RoR 4 application using Capistrano 2, Unicorn, Nginx. The problem is that I get 404 by assets (style sheets, javascripts).
Here is the Nginx access log:
89.0.40.233 - - [16/Mar/2014:08:24:26 +0000] "GET /stylesheets/application.css HTTP/1.1" 404 650 "http://host.cloudapp.net/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36" 89.0.40.233 - - [16/Mar/2014:08:24:26 +0000] "GET /javascripts/application.js HTTP/1.1" 404 650 "http://host.cloudapp.net/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
My assets are located in the application folder:
azureuser@host :~/apps/testify/current/public$ ls -a assets . application-d65a0eaefe6ca2eef9400045f94ab52b.js .. application-d65a0eaefe6ca2eef9400045f94ab52b.js.gz application-71e2591e9586afebf3fb4ff70aaae199.css manifest-a348973e84698f7d898e8021bd6e5388.json application-71e2591e9586afebf3fb4ff70aaae199.css.gz
My Nginx config:
upstream unicorn { server unix:/tmp/unicorn.testify.sock fail_timeout=0; } server { listen 80 default deferred; root /home/azureuser/apps/testify/current/public; location ^~ /assets/ { expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @unicorn; location @unicorn { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://unicorn; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; }
Where to begin?
source share