WebFaction
Community site: login faq

I am trying to move a Rails 4 app from Heroku to Webfaction. Most things are working except nginx appears to be looking in the wrong place for some of the compiled assets. Looking at the logs, requests like

GET /assets/application-*.js

are getting routed to ~/webapps/htdocs/assets/application-*.js instead of ~/webapps/[myapp]/[root]/public/assets/application-*.js where they exist.

I am not using Capistrano. I've tried various incarnations of nginx.conf, but nothing seems to change it. Here is the the current one:

env               GEM_HOME=/home/[user]/webapps/[my_app]/gems;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    access_log  /home/[user]/logs/user/access_[my_app].log  combined;
    error_log   /home/[user]/logs/user/error_[my_app].log   crit;

    include         mime.types;
    passenger_root  /home/[user]/webapps/[my_app]/gems/gems/passenger-4.0.53;
    passenger_ruby  /home/[user]/webapps/[my_app]/bin/ruby;
    sendfile        on;

    passenger_max_instances_per_app  1;
    rails_spawn_method               conservative;
    passenger_max_pool_size 2;

    server {
        listen             20285;
        passenger_enabled  on;
        root               /home/[user]/webapps/[my_app]/[root]/public;
        server_name        localhost;
        rails_env          production;

        location ~* ^/assets/ {
            root               /home/[user]/webapps/[my_app]/[root]/public;
            gzip_static on;
            expires max;
            add_header Cache-Control public;
        }
    }
}

The [] entries are just placeholders in this pasted text. Thanks for any help!

asked 26 Feb '15, 16:19

bsmith
4114
accept rate: 0%

edited 26 Feb '15, 16:20


false alarm. Rails application was set to serve up /[app_root] rather than /

Adjusted in the Webfaction Console and all appears good.

permanent link

answered 26 Feb '15, 19:36

bsmith
4114
accept rate: 0%

edited 26 Feb '15, 19:36

Glad to hear you found the solution.

(26 Feb '15, 23:39) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×108
×6
×4
×1

question asked: 26 Feb '15, 16:19

question was seen: 2,599 times

last updated: 26 Feb '15, 23:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM