我有一個Rails應用程序端口3101
運行,我把它提供給互聯網通過一個Apache反向代理設置(如一個通過的Phusion上this blog post建議。OmniAuth在反向代理設置使用錯誤的回調端口
我使用設計+ OmniAuth處理Facebook驗證
但是當我嘗試通過Facebook進行身份驗證,我重定向到URL:http://mydomain.com:3101/my_callback_path
我開始Rails應用程序與passenger start -a 127.0.0.1 -p 3101 -d
和我的Apache設置爲:
<VirtualHost *:80>
ServerName mydomain.com
PassengerEnabled off
ProxyPass/http://127.0.0.1:3101/
ProxyPassReverse/http://127.0.0.1:3101
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
我發現了一些答案,如this和this,但它們都是針對Nginx的設置。
我試過使用OmniAuth.config.full_host = 'http://my domain.com'
的初始值設定項,但我想知道在我的apache設置中是否有缺少的配置(如以前的答案)。
在此先感謝。
爲我工作!非常感謝 – Addsy