ssl passenger nginx rails 4 routing combine wrong port with https -
i folowed rails tutorial org tuto , made web site installed passenger, nginx.
works on prod env on heroku=>
http://klat.herokuapp.com/ (app not finished still better nothing)
here use =>
config.force_ssl = true (only heroku)
routes routes.rb =>
rails.application.routes.draw 'users/new' root 'static_pages#home' 'help' => 'static_pages#help' 'about' => 'static_pages#about' 'contact' => 'static_pages#contact' 'login' => 'static_pages#login' 'signup' => 'users#new' resources :users end ~/.bash_profile , ~/.bashrc got
#a generated key export secret_key_base="my_very_big_generated_key" export secret_token="my_very_big_generated_key" i generated openssl own certificates
ls ../cert/ server.crt server.csr server.key server.key.org server.pem and launch server command in local
passenger start -p 2000 --ssl-certificate ../cert/server.csr --ssl-port 20001 -e production i passed 2 days point can't find out why server starts @
http ://0.0.0.0:2000/ and redirects at
https ://0.0.0.0:2000 and no 1 page accessible: error
an error occurred during connection 0.0.0.0:2000. ssl received record exceeded maximum permissible length. (error code: ssl_error_rx_record_too_long) but in logs see
app 12832 stdout: app 12854 stdout: app 12854 stdout: started head "/" 127.0.0.1 @ 2015-04-24 18:09:30 +0200 app 12854 stdout: processing staticpagescontroller#home html {... rendering homepage wiht _header.erb _footer.erb etc ...} so can visit website non rendered css @ address:
http: //127.0.0.1:2000/ and still getting messages nginx server
actioncontroller::routingerror (no route matches [get] "/images/rails.png"): actioncontroller::routingerror (no route matches [get] "/stylesheets/application.css"): {...and more ...} i commented in every file in ruby on rails app ssl_force when uncomment in config/production.rb
config.force_ssl = true for local use, on
http ://127.0.0.1:2000/ => redirect https ://127.0.0.1:2000/ , => (error code: ssl_error_rx_record_too_long) http ://127.0.0.1 => unable locate https ://127.0.0.1 => unable locate http ://127.0.0.1:2000 => unable locate http ://127.0.0.1:2001 => unable locate https ://127.0.0.1:2000 => unable locate https ://127.0.0.1:2001 => unable locate just can't find out why openssl generated keys don't work, pages not rendered css , other ressources, it's maybe routing problem...
a little appreciated!
ps: (but please no such "use thin or puma or server, have constraint use @ choice nginx, lighthttpd or apache (the obvious answer nginx me)") , set own ssl certification in own server constraint in studies
finally
the command did start server without errors
passenger start --ssl-certificate ../cert/server.crt --ssl-certificate-key ../cert/server.key -e production --ssl without specifying ssl port , standart port
i added
gem 'rack-ssl', :require => 'rack/ssl' to gem file , did several bundle install/--deployment etc...
set in production.rb
config.force_ssl = true and in application_controller.rb
force_ssl so connection encrypted connect to
but... i'm still unhappy configurations because of presence of port number in url
anyway, now...
Comments
Post a Comment