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

Reverse Https Proxy Links use Http #1859

Closed
weisental opened this issue Jul 14, 2016 · 3 comments
Closed

Reverse Https Proxy Links use Http #1859

weisental opened this issue Jul 14, 2016 · 3 comments

Comments

@weisental
Copy link

Hi,

humhub Version: 1.0.1

Setup
Nginx SSL -> ProxyPass -> docker 3333:80 apache

BaseUrl Setting https://hum.dikas.de

Problem:
Uploaded Files links to http://hum.dikas.de/...

Nginx
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_set_header Host $http_host;

Thx

Jürgen Weisental

@rm-yakovenko
Copy link
Contributor

rm-yakovenko commented Oct 21, 2016

@weisental Try to add this to your nginx config:

 proxy_set_header        X-Forwarded-Proto $scheme;

@weisental
Copy link
Author

@B17

Thanks, works like a charm

@verement
Copy link
Contributor

FYI for anyone finding this doesn’t seem to work, I found it also necessary to modify the Yii configuration which, by default, filters the X-Forwarded-Proto (and other) headers unless explicitly whitelisted.

If your setup is already sufficiently firewalled such that only the reverse proxy has access, one solution could be to eliminate the header filtering via the following (in protected/config/web.php):

return [
        'components' => [
                'request' => [
                        'secureHeaders' => [],
                ],
        ]
];

Alternatively you can set an IP whitelist via trustedHosts.

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

No branches or pull requests

3 participants