[英]http instead of https for heroku sites
我已經構建了一個Rails應用程序,並通過heroku將其推向生產。 默認地址以https而不是http開頭。 我可以強迫它以http開頭嗎? 在我的production.rb文件中,我具有以下內容:
config.force_ssl = false
我也嘗試注釋掉該行,但仍然無法正常工作。 我還有什么需要做的嗎?
當我理解正確時,您想強制使用http而不是https。 我不知道您為什么要這樣做,我也不建議這樣做,但是您可以使用以下答案中的代碼示例:
class ApplicationController < ActionController::Base
before_filter do
if request.ssl? && Rails.env.production?
redirect_to :protocol => 'http://', :status => :moved_permanently
end
end
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.