Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Configuring varnish amd64 pfsense 2.0

    Scheduled Pinned Locked Moved pfSense Packages
    2 Posts 2 Posters 14.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      Guest
      last edited by

      So I want to get Varnish working on pfsense 2.0.

      I installed the package, and on backends I see nothign is there, if I add something it asks me for:

      Do I actually need to put in anything? Because I have no idea what to put in for most of these settings.

      And to check if Varnish is working on the VarnishSTAT page, which i don't think it is, it just posts

      VarnishSTAT Server logs as of Mon Dec 20 3:27:50 PST 2010

      Here is the default configuration, is it already setup for me?

      # Varnish configuration file
      # Automatically generated by the pfSense package system
      
      # This file is located in /var/etc/default.vcl
      
      sub vcl_error {
      	set obj.http.Content-Type = "text/html; charset=utf-8";
      synthetic {"
      
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      
      <title>"} obj.status " " obj.response {"</title>
      
       **We are very sorry but an error occurred during this request.** 
      
      Please press refresh in your browser to try again.
      
      Varnish Error "} obj.status " " obj.response {"
      
      "} obj.response {"
      
      ### Guru Meditation:
      
      XID: "} req.xid {"
      
      "};
      return(deliver);
      
      }
      
      sub vcl_recv {
      
      	# If the client sent an X-Forwarded-For header, remove it. 
      	# It cannot betrusted.
      	unset req.http.X-Forwarded-For;
      	# Note that we don't need to add the client ip to the X-Forwarded-For 
      	# header, varnish will do that for us
      	if (req.http.Accept-Encoding) {
      		# Handle compression correctly. Varnish treats headers literally
      		# not semantically. So it is very well possible that there are
      		# cache misses because the headers sent by different browsers
      		# aren't the same.
      		# @see: http:// varnish.projects.linpro.no/wiki/FAQ/Compression
      		if (req.http.Accept-Encoding ~ "gzip") {
      			# if the browser supports it, we'll use gzip
      			set req.http.Accept-Encoding = "gzip";
      		} elsif (req.http.Accept-Encoding ~ "deflate") {
      			# next, try deflate if it is supported
      			set req.http.Accept-Encoding = "deflate";
      		} else {
      			# unknown algorithm. Probably junk, remove it
      			unset req.http.Accept-Encoding;
      		}
      	}
      
      	if (req.request != "GET" && req.request != "HEAD") {
      		return(pipe);
      	}
      	return(lookup);
      }
      
      sub vcl_pipe {
      
      	# If we don't set the Connection: close header, any following
      	# requests from the client will also be piped through and
      	# left untouched by varnish. We don't want that.
      	set req.http.connection = "close";
      	# Note: no "pipe" action here - we'll fall back to the default
      	# pipe method so that when any changes are made there, we
      	# still inherit them.
      
      }
      
      

      Sorry I know nothing about Varnish.

      1 Reply Last reply Reply Quote 0
      • M
        mshundal
        last edited by

        read this => http://www.varnish-cache.org/docs/2.1/

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.