Question

Getting an error `127.0.0.1' is not a valid domain after every request on my rails app running on nginx server with unicorn. What to check?

****## Server Configuration

upstream app { server unix:/home/deploy/project/shared/sockets/unicorn.sock fail_timeout=0; }

server { listen 80; server_name *.mydomain;

root /home/deploy/project/current/public;

try_files $uri/index.html $uri @app;

location @app {
    proxy_pass http://app;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;

}

****## Stack trace

…by-2.1.2/gems/public_suffix-1.5.1/lib/ public_suffix.rb: 62:in parse' …ploy/bookafy/app/controllers/ application_controller.rb: 72:in set_domain_variable’ …ser-timezone-rails-1.0.1/lib/ browser-timezone-rails.rb: 15:in set_time_zone' …1.2/gems/actionview-4.1.5/lib/action_view/ rendering.rb: 30:in process’ …ct-1.3.1/app/middleware/ recurring_select_middleware.rb: 24:in call' …ems/apipie-rails-0.3.6/lib/apipie/ static_dispatcher.rb: 65:in call’ …gems/ruby-2.1.2/gems/turnout-2.4.1/lib/rack/ turnout.rb: 25:in call' …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 186:in call!’ …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 164:in call' …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 186:in call!’ …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 164:in call' …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 186:in call!’ …uby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ strategy.rb: 164:in call' …ruby-2.1.2/gems/omniauth-1.2.2/lib/omniauth/ builder.rb: 59:in call’ …ms/apipie-rails-0.3.6/lib/apipie/extractor/ recorder.rb: 132:in call' …m/gems/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ deflater.rb: 25:in call’ …ems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/ manager.rb: 35:in block in call' …ems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/ manager.rb: 34:in catch’ …ems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/ manager.rb: 34:in call' …/.rvm/gems/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ etag.rb: 23:in call’ …/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ conditionalget.rb: 25:in call' …/.rvm/gems/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ head.rb: 11:in call’ …-2.1.2/gems/rack-1.5.5/lib/rack/session/abstract/ id.rb: 225:in context' …-2.1.2/gems/rack-1.5.5/lib/rack/session/abstract/ id.rb: 220:in call’ …ruby-2.1.2/gems/quiet_assets-1.1.0/lib/ quiet_assets.rb: 27:in call_with_quiet_assets' …ms/request_store-1.2.0/lib/request_store/ middleware.rb: 8:in call’ …/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ methodoverride.rb: 21:in call' …vm/gems/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ runtime.rb: 17:in call’ …m/gems/ruby-2.1.2/gems/rack-1.5.5/lib/rack/ sendfile.rb: 112:in call' …by-2.1.2/gems/unicorn-5.5.0/lib/unicorn/ http_server.rb: 605:in process_client’ …vm/gems/ruby-2.1.2/gems/spawnling-2.1.6/lib/ patches.rb: 74:in process_client' …by-2.1.2/gems/unicorn-5.5.0/lib/unicorn/ http_server.rb: 700:in worker_loop’ …by-2.1.2/gems/unicorn-5.5.0/lib/unicorn/ http_server.rb: 548:in spawn_missing_workers' …by-2.1.2/gems/unicorn-5.5.0/lib/unicorn/ http_server.rb: 144:in start’

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@moisey I am getting the error in the application logs ie. unicorn.stdout.log