我想在西納特拉使用這一切HTTPS流量重定向到http如何在heroku上將Sinatra上的所有https流量重定向到http?
get "*" do
if request.secure?
redirect request.url.gsub(/^https/, "http")
else
pass # continue execution
end
end
然而,在Heroku自定義域,我的瀏覽器顯示我的錯誤:
This is probably not the site you are looking for!
You attempted to reach www.[domain].com, but instead you actually reached a server identifying itself as *.heroku.com.
我的DNS是配置了www子域的CNAME指向[domain].herokuapp.com
根據https://devcenter.heroku.com/articles/custom-domains
這是DNS問題嗎?購買SSL證書是否允許所有https流量在heroku上重定向到http?
我可能會嘗試:http://icelab.com.au/articles/useful-heroku-friendly-rewrites-with-rack-rewrite/ – zlog