After Varnish Configuration some of admin customer routers are redirecting to Dash Board.

I look to console, and saw that first I try to get to my costume controller, but it redirecting with Status 302 to Admin Home page.

If disable Varnish, everything works fine. Magento log and N-ginx log are clear. So, I'm sure this is Varnish.

Any advice?

  • how does the url of your custom admin page look like? Does it start with admin like every other admin link, or with something else?
    – Marius
    Aug 22, 2014 at 8:31
  • Hm, I checked this costume module route, and it starts like front end controller(not as other admin), I will check may be this is the reason
    – sergio
    Aug 22, 2014 at 8:35
  • I'm almost sure that this is the reason. You can either change your module to have the admin controller start with admin. This can be a bit painful but it's the right way to do it. The other option is to configure varnish and let your custom admin URLs pass.
    – Marius
    Aug 22, 2014 at 8:38

2 Answers 2


based on the comments...
The issue is caused by the custom module admin URL.
It does not start with admin (or the configured admin key), but with a custom key like the frontend URLs.
The clean option would be to modify the module to have the admin URL start with admin. But this can be painful and time consuming.
The quick and dirty way of doing it is to configure Varnish to let the custom URL pass.


In addition to Marius his answer, in most cases it will be enough in your default.vcl to change the next string:

if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?admin") {

with the next one:

if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?(admin|.*adminhtml)") {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.