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

HTTP_X_FORWARDED_PROTO not handling at all #115

Closed
firatagdas opened this issue Dec 23, 2016 · 2 comments
Closed

HTTP_X_FORWARDED_PROTO not handling at all #115

firatagdas opened this issue Dec 23, 2016 · 2 comments

Comments

@firatagdas
Copy link

I 'm currently using AWS and my hosts SSL handling done by AWS. So when I use forced_ssl, ForcedSslListener simply does redirect loop to same domain which is not expected. Can you add a proper handling for that?

@Seldaek
Copy link
Member

Seldaek commented Dec 23, 2016

You need to configure the Request headers that symfony trusts.

I use this for AWS application load balancer, which does SSL termination, in app.php:

Request::setTrustedProxies([$_SERVER['REMOTE_ADDR']]);
Request::setTrustedHeaderName(Request::HEADER_FORWARDED, '');
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, 'X_FORWARDED_FOR');
Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, '');
Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, 'X_FORWARDED_PROTO');
Request::setTrustedHeaderName(Request::HEADER_CLIENT_PORT, 'X_FORWARDED_PORT');

@Seldaek Seldaek closed this as completed Dec 23, 2016
@firatagdas
Copy link
Author

Thank you so much. It worked :) I didn't know this can be solved with symfony.

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

2 participants