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

HTTPS for next page #169

Open
FelixRijkers opened this issue Aug 27, 2019 · 11 comments
Open

HTTPS for next page #169

FelixRijkers opened this issue Aug 27, 2019 · 11 comments
Assignees
Labels

Comments

@FelixRijkers
Copy link

Hi there,

I'm connecting trough HTTPS but Akeneo always returns url's with http for example for the next page of results. Any idae how to handle this?

Best Regards

@soyuka
Copy link

soyuka commented Feb 5, 2020

To get this right you have to configure your trusted proxy (app.php or index.php) there's a comment there. Then, Request->isSecure() should return true.

@Reiner030
Copy link

Reiner030 commented Apr 3, 2020

Since there was a question in Slack referencing this issue here the solution for further searcher.

If you have a proxy setup commonly they can/should set an additional request header like:
X-Forwarded-Proto: https

Which you can use for setting SSL secured mode on Apache vhost which is forwarded to PHP so it could regonize the encrypted connection scheme.

<VirtualHost *:80>
...
        SetEnvIf     X-Forwarded-Proto     https     HTTPS=on
...
</VirtualHost>

Bests

@frent
Copy link

frent commented Apr 6, 2020

This is all kinda vague for me and not really straight forward to implement.

Why not have an easy setting for Akeneo to use SSL or not SSL.
Or even better when you request a page in Akeneo API you send the pagining back in the same method as the request - http or https...

@Reiner030
Copy link

I have no clue if there is a direct configuration setting in Akeneo.
My view is as "system administrator" which have to get and stay it running.

Thats the point you should consider yourself for next round which maybe someone else then could respond to if interested:

Why not have an easy setting for Akeneo to use SSL or not SSL.

I offered this switch in Apache config by setting right variable to on (it's automatically set by mod_ssl which is in this case isn't used):
SetEnvIf X-Forwarded-Proto https HTTPS=on

If you are lazy or unwillingly to set it conditionally then change it to
SetEnv HTTPS on

Or even better when you request a page in Akeneo API you send the pagining back in the same method as the request - http or https...

HOW show Akeneo know about it e.g. if there is Apache http running behind an HAproxy offering SSL termination? => Solution: my vhost / SetEnvIf example

@frent
Copy link

frent commented Apr 17, 2020

I am still confused about all this. I tried the suggestions you gave but it did not give me a sollution. And if I look at the original question I'm not alone with this problem.

If I try the same request (no http) with https://reqbin.com/ then it follows the redirect to https and returns the data.

For some reason the "GuzzleHttp\Psr7\Request" does not follow this redirect, although in there documentation it says it would. (http://docs.guzzlephp.org/en/stable/quickstart.html#redirects)

@ghoussard
Copy link

ghoussard commented Jun 4, 2020

Since there was a question in Slack referencing this issue here the solution for further searcher.

If you have a proxy setup commonly they can/should set an additional request header like:
X-Forwarded-Proto: https

Which you can use for setting SSL secured mode on Apache vhost which is forwarded to PHP so it could regonize the encrypted connection scheme.

<VirtualHost *:80>
...
        SetEnvIf     X-Forwarded-Proto     https     HTTPS=on
...
</VirtualHost>

Bests

Works for me. Thanks!
Running PIM CE in docker container behind a Traefik reverse proxy

@meisterlampe
Copy link

Since there was a question in Slack referencing this issue here the solution for further searcher.

If you have a proxy setup commonly they can/should set an additional request header like:
X-Forwarded-Proto: https

Which you can use for setting SSL secured mode on Apache vhost which is forwarded to PHP so it could regonize the encrypted connection scheme.

<VirtualHost *:80>
...
        SetEnvIf     X-Forwarded-Proto     https     HTTPS=on
...
</VirtualHost>

Bests

Also works for me using nginx as reverse proxy. Thanks.
To my mind, this is the right way to solve this problem when working with reverse proxies.

@karimennassiri
Copy link

Since there was a question in Slack referencing this issue here the solution for further searcher.
If you have a proxy setup commonly they can/should set an additional request header like:
X-Forwarded-Proto: https
Which you can use for setting SSL secured mode on Apache vhost which is forwarded to PHP so it could regonize the encrypted connection scheme.

<VirtualHost *:80>
...
        SetEnvIf     X-Forwarded-Proto     https     HTTPS=on
...
</VirtualHost>

Bests

Also works for me using nginx as reverse proxy. Thanks.
To my mind, this is the right way to solve this problem when working with reverse proxies.

Can you please put here what you've done in Nginx please !

@tschallacka
Copy link

I simply added HTTPS=On to the .env file and it works like a charm.
No need to mess with the proxy config.

@jmleroux
Copy link

Could we consider it as resolved and close it?

@tschallacka
Copy link

I would suggest adding the https=on in the .env to the documentation for use in proxied servers asa solution

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

No branches or pull requests

9 participants