Git Product home page Git Product logo

ddev-varnish's Introduction

tests project is maintained

ddev-varnish

This repository allows you to quickly install the Varnish reverse proxy into a DDEV project using just ddev get ddev/ddev-varnish.

Installation

  1. ddev get ddev/ddev-varnish
  2. ddev restart

Explanation

The Varnish service inserts itself between ddev-router and the web container, so that calls to the web container are routed through Varnish first. The docker-compose.varnish.yaml installs Varnish and uses the default domain as its own host name. A docker-compose.varnish-extras.yaml file is generated on install which replaces the VIRTUAL_HOST variable of the web container with a sub-domain of the website URL. For example, mysite.ddev.site, would be accessible via Varnish on mysite.ddev.site and directly on novarnish.mysite.ddev.site.

If you use a project_tld other than ddev.site or additional_fqdns DDEV will help add hosts entries for the hostnames automagically; however, you'll need to add entries for the novarnish.* sub-domains yourself, e.g. ddev hostname novarnish.testaddfqdn.random.tld 127.0.0.1.

Run ddev get ddev/ddev-varnish after changes to name, additional_hostnames, additional_fqdns, or project_tld in .ddev/config.yml so that .ddev/docker-compose.varnish-extras.yaml is regenerated.

Helper commands

This addon also providers several helper commands. These helpers allow developers to run Varnish commands from the host, however, the commands are actually run inside the Varnish container.

Command Description
ddev varnishd Varnish-cli
ddev varnishadm Control a running Varnish instance
ddev varnishhist Display Varnish request histogram
ddev varnishlog Display Varnish logs
ddev varnishncsa Display Varnish logs in Apache / NCSA combined log format
ddev varnishstat Display Varnish Cache statistics
ddev varnishtest Test program for Varnish
ddev varnishtop Display Varnish log entry ranking

See The Varnish Reference Manual for more information about the commands, their flags, and their arguments.

Additional Configuration

  • You may want to edit the .ddev/varnish/default.vcl to meet your needs. Remember to remove '#ddev-generated' from the file if you want your changes to the file preserved.

Maintained by @jedebois and @rfay

Based on the original ddev-contrib recipe pioneered by rikwillems

ddev-varnish's People

Contributors

rfay avatar tyler36 avatar jedubois avatar skeemer avatar mattstein avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.