Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:29:43+00:00 2026-05-31T16:29:43+00:00

I have Varnish running on IP Foo with IP Bar as default backend. I

  • 0

I have Varnish running on IP Foo with IP Bar as default backend. I visit Varnish on Foo, Apache on Bar returns a 302 and rather than a response coming from Foo, the browser is redirected to Bar, thus missing Varnish altogether.

Is there a fundamental concept of Varnish I am misunderstanding here? I’ve run Varnish with the exact same VCL on the same server as Apache and it worked fine.

Thanks in advance for any help/tips/pointers 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:29:44+00:00Added an answer on May 31, 2026 at 4:29 pm

    You’re getting a redirect (302) from your back-end. Redirects have to be absolute, and your back-end chooses to use it’s own ip/hostname for the url.

    You can solve this in many ways:

    • Use the same virtual host on the back-end (e.g. foo.com, which ip points to your varnish but is accepted as a virtual host on your back-end). Your back-end has to be smart enough to use this for redirects.
    • Forward the original ip-adress as a custom HTTP Request Header to the back-end (e.g. see https://serverfault.com/questions/340500/varnish-forward-client-ip-address-to-backend ). Your back-end has to be smart enough to use this for redirects.
    • Rewrite 302 answers in varnish (replace the bar.com part in the Location header with foo.com)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a server which needs to serve multiple domains though varnish e.g. example1.com,
I have just installed varnish and its ready to serve web pages. Problem is
I have the installation with Apache2, nginx and Varnish above them. Varnish receives the
I have a horizontal navigation bar. Each button is a span with a background
I have a Rails app that is running on port 8080 that I need
We're currently running a site with: Pressflow 5.23.50 Varnish 2.1.4 I suspect some of
Varnish scripting seems rather robust for the vcl but I can't yet figure out
I am configuring varnish for the first time, and I have come across an
We're running Plone 4.1 with plone.app.caching behind Apache 2.2 with mod_cache and mod_disk_cache. The
I'm running on XCode and using OpenGL ES 1.1 and I have two classes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.