📄 Viewing: //etc/varnish/conf.d/vhosts/online.marutioverseas.in.conf
backend cwpa9b087be6ea95bc3b6937464d8c20deb {
	.host = "193.37.152.120";
	.port = "8181";
}

sub vcl_recv {
	if (req.http.host ~ "online.marutioverseas.in") {
		set req.backend_hint = cwpa9b087be6ea95bc3b6937464d8c20deb;

		# Always cache the following file types for all users.
		if (req.url ~ "(?i)\.(png|gif|jpeg|jpg|ico|swf|css|js|html|htm)(\?[a-z0-9]+)?$") {
			unset req.http.Cookie;
		}

		# Remove any Google Analytics based cookies
		set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");
		set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");
		set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", "");
		set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", "");
		set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", "");
		set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", "");

		# Do not cache AJAX requests.
		if (req.http.X-Requested-With == "XMLHttpRequest") {
			return(pass);
		}

		# Post requests will not be cached
		if (req.http.Authorization || req.method == "POST") {
			return (pass);
		}
		if (req.method != "GET" && req.method != "HEAD") {
			return (pass);
		}

		# Do not cache Authorized requests.
		if (req.http.Authorization) {
			return(pass);
		}

		# LetsEncrypt Certbot passthrough
		if (req.url ~ "^/\.well-known/acme-challenge/") {
			return (pass);
		}

		if (req.url ~ "^/\.well-known/pki-validation/") {
			return (pass);
		}

		# Forward client's IP to the backend
		if (req.restarts == 0) {
			if (req.http.X-Real-IP) {
				set req.http.X-Forwarded-For = req.http.X-Real-IP;
			} else if (req.http.X-Forwarded-For) {
				set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
			} else {
				set req.http.X-Forwarded-For = client.ip;
			}
		}

		return (hash);
	}
}

← Back to directory