I have an application which has a controller with actions which are forced to https and one exception using the following code:
force_ssl except: :show, if: :ssl_configured?
def ssl_configured?
Rails.logger.debug "ssl configured"
ENV["ENABLE_HTTPS"] == "yes"
end
Within one of the views I then have the url defined to access the http link as:
place_url(place.id, protocol: 'http')
When I run this on my local server (using an NGINX/WEBrick) all actions are redirected to HTTPS except for the show action which is remains unsecured.
However when I deploy to heroku all actions redirect to a secure connection even though the link to the place show action is shown as http.
I have not done any configuration on Heroku (other than setting the environment variable) so the app is running on the WEBrick server.
How can I establish why the exception is being ignored on Heroku? Would I be better starting by configuring a unicorn server as advised in the Heroku docs?