miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
7.01k stars 732 forks source link

config.Opts.HTTPS gets overwritten if there are both HTTPS and HTTP reverse proxies #856

Open yelite opened 4 years ago

yelite commented 4 years ago

At service/httpd/middleware.go#L22,

        if r.Header.Get("X-Forwarded-Proto") == "https" {
            config.Opts.HTTPS = true
        }

If there are traffic from both HTTPS and HTTP reverse proxy, config.Opts.HTTPS will be updated to true after the first request from the HTTPS proxy. After that, all HTTP traffic will get secure cookie which breaks lots of things.

I believe this is one of the cause of #414

yelite commented 4 years ago

I have a fix on https://github.com/yelite/v2/tree/fix-http-secure-cookies. It's deployed to my home server and solved the problem. Since I haven't written go before, I am not sure if it's the best way to fix it.

mrchi commented 2 weeks ago

I also got the same issue. The miniflux I deployed on the nas at home uses http for LAN access and https for internet access. Now LAN access is basically unavailable.