docker 部署后无法使用
dahangda opened this issue · comments
第一部分log
, [2020-05-28T14:18:27.431368 #54] INFO -- : [eb5e2080-d98b-4238-84c6-47473ed865ad] Parameters: {"utf8"=>"✓", "authenticity_token"=>"/M8ThK6SNGCeD4Fmq9F4g3Q6UaAl4RELmWTWKCieAtHyOeHVJStOyOjZIkKwjI31mMiKcvX3AV1hVnYX4kjsDQ==", "user"=>{"role"=>"admin", "email"=>"yanhang291@gmail.com", "password"=>"[FILTERED]"}, "commit"=>"新建"}
W, [2020-05-28T14:18:27.432759 #54] WARN -- : [eb5e2080-d98b-4238-84c6-47473ed865ad] HTTP Origin header (http://115.28.128.158:3000) didn't match request.base_url (https://115.28.128.158:3000)
I, [2020-05-28T14:18:27.433061 #54] INFO -- : [eb5e2080-d98b-4238-84c6-47473ed865ad] Completed 422 Unprocessable Entity in 2ms (ActiveRecord: 0.0ms)
F, [2020-05-28T14:18:27.433874 #54] FATAL -- : [eb5e2080-d98b-4238-84c6-47473ed865ad]
F, [2020-05-28T14:18:27.433917 #54] FATAL -- : [eb5e2080-d98b-4238-84c6-47473ed865ad] ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
F, [2020-05-28T14:18:27.433938 #54] FATAL -- : [eb5e2080-d98b-4238-84c6-47473ed865ad]
F, [2020-05-28T14:18:27.433980 #54] FATAL -- : [eb5e2080-d98b-4238-84c6-47473ed865ad] actionpack (5.1.7) lib/action_controller/metal/request_forgery_protection.rb:195:in handle_unverified_request' [eb5e2080-d98b-4238-84c6-47473ed865ad] actionpack (5.1.7) lib/action_controller/metal/request_forgery_protection.rb:227:in
handle_unverified_request'
[eb5e2080-d98b-4238-84c6-47473ed865ad] actionpack (5.1.7) lib/action_controller/metal/request_forgery_protection.rb:222:in verify_authenticity_token' [eb5e2080-d98b-4238-84c6-47473ed865ad] activesupport (5.1.7) lib/active_support/callbacks.rb:413:in
block in make_lambda'
[eb5e2080-d98b-4238-84c6-47473ed865ad] activesupport (5.1.7) lib/active_support/callbacks.rb:197:in block (2 levels) in halting' [eb5e2080-d98b-4238-84c6-47473ed865ad] actionpack (5.1.7) lib/abstract_controller/callbacks.rb:12:in
block (2 levels) in module:Callbacks'
[eb5e2080-d98b-4238-84c6-47473ed865ad] activesupport (5.1.7) lib/active_support/callbacks.rb:198:in block in halting' [eb5e2080-d98b-4238-84c6-47473ed865ad] activesupport (5.1.7) lib/active_support/callbacks.rb:507:in
block in invoke_before'
2.第二部分log
F, [2020-05-28T08:55:41.498512 #54] FATAL -- : [75a779a8-a986-4165-9955-6f7e888b1e89] ActionController::RoutingError (No route matches [GET] "/apphost"):
F, [2020-05-28T14:19:03.644646 #54] FATAL -- : [e362da56-e017-4caf-b841-b64977fb572d] ActionController::RoutingError (No route matches [GET] "/sessions"):
F, [2020-05-28T14:56:19.928621 #55] FATAL -- : [46d26ba9-c1ef-4abd-8ee1-f0c66eff0e37] ActionController::RoutingError (No route matches [GET] "/admin"):
F, [2020-05-29T08:37:31.996627 #54] FATAL -- : [657b77de-7114-45cc-bea1-f50de07cc701] ActionController::RoutingError (No route matches [GET] "/user"):
F, [2020-05-29T08:47:36.076687 #54] FATAL -- : [89c6c6df-86d1-401e-abdd-6ee85715c4f2] ActionController::RoutingError (No route matches [GET] "/user"):
看样子是 ng 或者浏览器修改了请求,导致安全拦截了
建议尝试隐身窗口,或者用他其不装插件的浏览器试试。排除下是不是浏览器问题
@iBcker 尝试了不行,很奇怪。
@iBcker ng 是什么?
经测试是因为默认的nginx.conf中的一个配置导致了请求会由http post 到https 所以浏览器会拒绝。
解决办法:将 docker/nginx.conf 中 proxy_set_header X-Forwarded-Ssl on; 这个配置前面加个# 号即可解决。