Question

I have a spree application that runs perfect on my local machine with the development environment.

I managed to deploy the app to a vps using capistrano, everything works just fine.

I can get to http://mydomain.com and I see the empty store. Looks good so far.

The thing is that when I try to go to http://mydomain.com/login or http://mydomain.com/admin

The browser gets no response and I see no trails on apache's error log nor in the app's production log.

Here are the routes taken from rake routes:

admin_search_users GET    /admin/search/users(.:format)                                              spree/admin/search#users
login GET    /login(.:format)                                                           spree/user_sessions#new

curl output:

→ curl -I http://mydomain.com/login
HTTP/1.1 301 Moved Permanently
Date: Mon, 27 Jan 2014 01:41:22 GMT
Server: Apache/2.4.6 (Ubuntu)
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: chrome=1
Cache-Control: no-cache
X-Request-Id: 8e55b59d-5f76-4136-bf2c-a54d427025f6
X-Runtime: 0.009355
X-Powered-By: Phusion Passenger 4.0.36
Set-Cookie: request_method=HEAD; path=/
Set-Cookie: _artemia_session=UnBvNHdLMWxCL1pMcUdleWhsZXRZNG5sUnd2eDdKS2JYNldreHUwTnZpMFdpVGYvTXoxMjBOOTFmWmNyTVdmRVE1TTUrNy90eDhTejNtanRvZWdrS0FvNlIzVGYwbDN2NnpMbldONEJYVE9TSzNndDZQemhHRzRiWmNxMWJ4MStzOE93cjFjNEFZWUxKZXdUakFlWWJyb1VaK3pWdFRVc0hKL0Fjb1JHb0lnPS0tRDhTa0tQdGh2WkNYK0dHSlhoZmhFQT09--5eaabba7b19b66079a20bf24da9cfb97b2458287; path=/; HttpOnly
Location: https://mydomain.com/login
Status: 301 Moved Permanently
Content-Type: text/html; charset=utf-8

curl hit on rails production log:

I, [2014-01-27T01:41:22.847239 #31960] INFO -- : Started HEAD "/login" for 190.134.31.176 at 2014-01-27 01:41:22 +0000
I, [2014-01-27T01:41:22.849285 #31960] INFO -- : Processing by Spree::UserSessionsController#new as /
I, [2014-01-27T01:41:22.855083 #31960] INFO -- : Redirected to https://mydomain.com/login
I, [2014-01-27T01:41:22.855384 #31960] INFO -- : Filter chain halted as # rendered or redirected
I, [2014-01-27T01:41:22.855688 #31960] INFO -- : Completed 301 Moved Permanently in 6ms (ActiveRecord: 0.0ms)

Was it helpful?

Solution

Your route is being re-directed to your secure server. Do you have your SSL/HTTPS server configured correctly? Do you have the following setting in config/environments/production.rb and do you want it set?

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top