Magento2: SSL + VARNISH = Admin loop

Created on 23 Nov 2016  路  7Comments  路  Source: magento/magento2

Hi,

I am trying since weeks to proxy pass SSL termination to varnish to allow Https on magento 2.1.2 without success.
My config is, nginx on port 8080, Varnish on port 80 and 6086,PROXY, Hitch on port 443 and SSL termination to varnish --> 6086,PROXY. PHP 7fpm

When enabling Https for both Backend Frontend an infinite loop occurs.
If I just eanable 443 in nginx, it works fine...

Have you planed to do something to solve SSL issues with varnish please?
Thanks for your help,
Guy

needs update

Most helpful comment

I don't know if that will help but i had the same problem with varnish, ssl and a nginx proxy in a docker environment.
What did the trick for me was to add fastcgi_param HTTPS on; to the location ~ (index|get|static|report|404|503)\.php$ {...} block in my nginx config.

All 7 comments

@sheakspeer thank you for your feedback.
The GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for technical questions.
If you think it to be an issue please format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result. Please, also identify which version of Magento you are running.
If it is more an improvement please submit it to the new Magento 2 Feature Requests and Improvements forum (see details here).

I don't know if that will help but i had the same problem with varnish, ssl and a nginx proxy in a docker environment.
What did the trick for me was to add fastcgi_param HTTPS on; to the location ~ (index|get|static|report|404|503)\.php$ {...} block in my nginx config.

@sheakspeer

I did run into this issue using Nginx as a reverse proxy. If there is a redirect loop on the admin, try another browser (I got it to work with Safari, I think there was something in the browser cache). Then set the admin to use SSL in the backend, and clear the cache.

I can confirm that Magento's side of the equation works fine and this is a configuration issue on your server or a browser cache issue. Without knowing more about your setup I couldn't say exactly where the issue is. There are quite a few tutorials about this on the internet that are incomplete, outdated or flat out wrong and getting this to work perfectly took me a lot of testing. I tried using Hitch but ran into some issues that I was unable to solve with my knowledge and the documentation available at the time, so I left it.

I don't see a reason to add Hitch because Nginx solves the reverse proxy problem really well. I am using Acmetool for SSL and Nginx as a reverse proxy and it works flawlessly for the front and the admin. I have an incomplete bash script for a ground up Magento install using Ubuntu 16.04/Nginx/PHP7/MariaDB/Acmetool/Varnish 4/Nginx reverse proxy if you'd like to look at it.

According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

@sheakspeer Running Nginx in front of Varnish for SSL termination works fine for me, so I don't think it's a Magento issue.

please set: web/secure/use_in_frontend and web/secure/use_in_adminhtml to 0

Please read here for more detail:
https://mrvts.wordpress.com/2018/12/17/magento-2-nginx-varnish-full-page-cache-backend-admin-redirect-loop-why-and-how-to-fix/

I don't know if that will help but i had the same problem with varnish, ssl and a nginx proxy in a docker environment.
What did the trick for me was to add fastcgi_param HTTPS on; to the location ~ (index|get|static|report|404|503)\.php$ {...} block in my nginx config.

For me work! Full Thanks!

Was this page helpful?
0 / 5 - 0 ratings