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

Add a parameter to origin_referrer_check, to skip checking scheme #236

Open
asmanur opened this issue Jul 6, 2022 · 3 comments
Open

Add a parameter to origin_referrer_check, to skip checking scheme #236

asmanur opened this issue Jul 6, 2022 · 3 comments

Comments

@asmanur
Copy link

asmanur commented Jul 6, 2022

Hello,

I am running a dream server under a lighttpd proxy. The lighttpd is listening on https to the outer world but communicates in http internally with the dream server. This confuses the ORC because it seens a request with a host 'https://host' but is a http server. I was wondering if we could add a parameter to origin_referrer_check to skip the check of the schemes?

Anyways, thanks for the wonderful work on dream.

@gstrauss
Copy link

gstrauss commented Apr 24, 2023

@asmanur try adding this to your lighttpd.conf reverse-proxy config:

proxy.header += (
    "https-remap" => "enable",
    "map-host-request"  => ("-" => "-"),
    "map-host-response" => ("-" => "-")
)

https://wiki.lighttpd.net/mod_proxy

@aantron
Copy link
Owner

aantron commented Apr 24, 2023

Thanks @asmanur for the report and @gstrauss for the suggestion! I'm looking for a bit of time to actually try this out and consider what's the best way to address it.

@richardhuxton
Copy link

I encountered the same issue with an nginx proxy terminating the tls for a dream backend.

Counter-intuitively while trying to get the headers to match I got this error:

Origin-Host mismatch: 'https://aaa.bbb.org.uk:8000' vs. 'https://aaa.bbb.org.uk:8000'

That was because the actual scheme in the Origin header isn't compared to the Host header but to Helpers.tls request which presumably is false because dream isn't handling the tls.

For anyone who comes across the same issue, the config for nginx needed to be:

proxy_set_header Host $http_host;
proxy_set_header Origin http://$http_host;

Personally, I think just a note in the e-json example would be enough to cover this issue. You could include the example config fragments - with apache/haproxy examples too that would cover most people I suspect.

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

4 participants