Output redirections in shell commands may be shorten.
Here are some examples
Output redirections in shell commands may be shorten.
Here are some examples
Most VCL examples and Varnish wiki offers two solutions for custom error pages. First one is a strict HTML code in a synthetic block and second one is a reading html file from disk with inline C. Both variants work, but makes our VCL code nasty (also second variant with inline C reads file from disk on every ‘wrong’ request).
I want to suggest third variant, that combines both previous variants without their bad side.
Proudly presents my own nginx PKGBUILD for AUR (ArchLinux User Repository) with additional and 3d party modules:
Usually we have more than one development environments for projects on our development servers or workstations. And part of them needs to be proxied with Varnish.
Varnish configurations may be same and may be different. One or three different configurations may be stored in default configuration file (default.vcl). But if count of configurations grows up, then file becomes unreadable and inconvenient.
I suggest to use a simple solution to split configurations to separate files and include them in main configuration file. It add some overhead for same configurations, but makes confuguration easier.
Sometimes we need restrict access to site that cached by Varnish with basic HTTP authentication.
Basic method is enable it on backend (Apache, nginx, lighttpd or other web-server). But after the first correct request, it will be cached on Varnish and all other clients requests would be without authentication.
Solution for this situation is pass all request with authentication to backend with next statement:
1 2 3 4 | |
As we remember, caching still required for this site. So, statement above is not suitable for our conditions.
Good workaround is to check HTTP authentication at the Varnish.
Well then do it in VCL.