[erlang-questions] Force HTTP to HTTPS in Yaws
Kimmo Gläborg
kimmo@REDACTED
Tue Jul 8 09:46:41 CEST 2008
>> How can I configure Yaws to force https? Like I would like any user
>> that loads the
>> site in http, to be redirected to https.
>
> One way of doing it would be to change your yaws.conf file to have two
> docroot directories. One for http and the other one for https.
> https-docroot would be the one you are currently using. http-docroot
> would contain index.yaws file only which would always redirect to
> https. It could look like this (listing of index.yaws):
>
> <erl>
> out(A) ->
> {redirect,"https://localhost/"}.
> </erl>
>
> Change the above with your domain. This will however break any
> functionality that was available through http.
Thanks Michal! I probably would like to keep the http environment
working aswell.
Isn't there a way to configure this in the Yaws config environment? (I
believe this is
just a setting, both in IIS and Apache for example..)
// kimmo
More information about the erlang-questions
mailing list