Forcing Spree Commerce to disable SSL in production mode

When I change my application (Spree Commerce) to working mode, the application works fine, but when I want to go to the "/ admin" page , the server throws me ". This page is not accessible" in the Chrome browser. In addition, I do not know if this is normal, but when the server gives me an error, the server changes the URL from

http : // localhost: 3000 / to https : // localhost /

Can anyone help? Do I need to do something on the admin and login pages so that they work correctly? This is my first development with Rails.

As an example, these are the logs that are created when I try to go to http://localhost:3000/login

I, [2014-06-19T17:09:17.368486 #4208]  INFO -- : Started GET "/login" for 127.0.0.1 at 2014-06-19 17:09:17 -0500
I, [2014-06-19T17:09:17.531531 #4208]  INFO -- : Processing by Spree::UserSessionsController#new as HTML
I, [2014-06-19T17:09:17.697253 #4208]  INFO -- : Redirected to https://localhost/login
I, [2014-06-19T17:09:17.697444 #4208]  INFO -- : Filter chain halted as #<Proc:0x00000004f9a0c0@/home/angel/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-4.0.4/lib/action_controller/metal/force_ssl.rb:65> rendered or redirected
I, [2014-06-19T17:09:17.697662 #4208]  INFO -- : Completed 301 Moved Permanently in 166ms (ActiveRecord: 0.0ms)`
+4
source share
2 answers

Install a stone to avoid this problem:

https://github.com/spree/spree_auth_devise

Someone had this problem before:

Spree: disabling SSL / admin forwarding to the site

also:

I had the same problem fixed this by adding:

File Creation:

../config/initilizers/spree.rb

Spree.config do |config|
  config.allow_ssl_in_production = false #This line
end

Seems to work.

+12
source

You just need to set in in the initializer spree. allow_ssl_in_development_and_test false

initializers /spree.rb

Spree.config do |config|
  #...
  config.allow_ssl_in_development_and_test = false
  #...
end

Note. . SSL request removed at Spree 3.0. Check out the release note here.

0
source

Source: https://habr.com/ru/post/1545293/


All Articles