Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL scheme is not preserved in emails #24

Open
mefyl opened this issue Nov 24, 2020 · 4 comments
Open

URL scheme is not preserved in emails #24

mefyl opened this issue Nov 24, 2020 · 4 comments

Comments

@mefyl
Copy link

mefyl commented Nov 24, 2020

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.

@glondu
Copy link
Owner

glondu commented Nov 24, 2020

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).

@glondu
Copy link
Owner

glondu commented Nov 24, 2020

See also #22

@mefyl
Copy link
Author

mefyl commented Nov 24, 2020

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.

@glondu
Copy link
Owner

glondu commented Jun 8, 2021

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants