当我点击生产网址https://studio.myapp.biz
时,它会重定向到https://studio.myapp.bizusers/sign_in
。请注意,它不会在域之后添加/
。所有omniauth回调网址都会出现此问题。
该应用程序在Apache 2 + Passenger 5.0.25上运行。
的Apache
<VirtualHost *:443>
DocumentRoot /var/www/rubyapps/studio_server/current/public
ServerName studio.myapp.biz
PassengerRuby /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers/ruby
RailsEnv production
<Directory /var/www/rubyapps/studio_server/current/public>
allow from all
Require all granted
AllowOverride All
Options -Indexes +FollowSymLinks
</Directory>
</VirtualHost>
的routes.rb
devise_for :users, :controllers => {
registrations: 'registrations',
invitations: 'users/invitations',
omniauth_callbacks: "users/omniauth_callbacks",
}
我无法弄清问题在哪里。请帮忙。
答案 0 :(得分:0)
在Apache重定向语句中,重定向到SSL的80重定向中缺少尾部斜杠:
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName studio.myapp.biz
Redirect permanent / https://studio.myapp.biz/
<Directory /var/www/html>
allow from all
Require all granted
AllowOverride All
Options -Indexes +FollowSymLinks
</Directory>
</VirtualHost>
虽然我们必须在重定向语句中明确指定/
,但这看起来很令人惊讶。