Open mefyl opened 4 years ago
I think that if you configure ocsigenserver to serve https, then links are in https. For reverse proxy situations (where the connection to ocsigenserver is made in http), there is the <rewrite-prefix>
directive: I usually use <rewrite-prefix src="http:" dst="https:"/>
(in the <eliom>
section).
Thanks for you help, your solution does indeed work. I did see the documentation but was using <redirect/>
, sorry about that.
I think this could be done automatically though: my server is behind a reverse proxy, but the hostname and port are correct, probably thanks to ocsigenserver reading X-Forwarded-Host
headers ? This make it work almost out of the box, which is great, but using X-Forwarded-Proto
could then autodetermine the protocol too and make it perfect. But this may be an issue in Eliom_uri.make_string_uri
rather than Belenios then.
After grep-ing through its codebase, I don't think ocsigenserver reads X-Forwarded-Host
(nor does eliom). It may be possible that your reverse-proxy doesn't touch the Host
header, which explains why the hostname is correct in absolute links generated by Eliom_uri.make_string_uri
. This needs further investigation...
When sending out password emails to the user, the correct hostname / port is preserved even behind a proxy, but it seems to me the scheme is always forced to http.