Skip to content

Commit

Permalink
Added BYPASS_VARNISH flag to route requests around varnish directly t…
Browse files Browse the repository at this point in the history
…o Nginx
  • Loading branch information
davidalger committed Dec 4, 2019
1 parent 8a55805 commit 109d8b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ UNRELEASED
* Added labels to the `php-fpm` container in `magento2` environment to support use of Live Reload via JS injection in the site header (see README for details!)
* Updated Mutagen usage to rely on new commands and configuration in Mutagen 0.10.0 (Warden will now throw an error if you attempt to start a sync and have a version of Mutagen older than 0.10.0 installed)
* Added WARDEN_ENV_NAME as prefix to each container hostname in compose configs (issue #29)
* Added simple `BYPASS_VARNISH` flag which when set in project `.env` file will cause Traefik to route requests directly to `nginx` container rather than `varnish`

0.1.11
===============
Expand Down
11 changes: 10 additions & 1 deletion environments/magento2.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ services:
- NGINX_TEMPLATE=magento2.conf
depends_on:
- php-fpm
labels:
- traefik.enable=${BYPASS_VARNISH:-false}
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.tls=true
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.priority=2
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.rule=HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`)
- traefik.http.services.${WARDEN_ENV_NAME}-nginx.loadbalancer.server.port=80
networks:
- warden
- default

varnish:
hostname: "${WARDEN_ENV_NAME}-varnish"
Expand Down Expand Up @@ -35,7 +44,7 @@ services:
labels:
- traefik.enable=true
- traefik.http.routers.${WARDEN_ENV_NAME}-livereload.tls=true
- traefik.http.routers.${WARDEN_ENV_NAME}-livereload.priority=1
- traefik.http.routers.${WARDEN_ENV_NAME}-livereload.priority=2
- traefik.http.routers.${WARDEN_ENV_NAME}-livereload.rule=
HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`) && Path(`/livereload.js,/livereload`)
- traefik.http.routers.${WARDEN_ENV_NAME}-livereload.service=${WARDEN_ENV_NAME}-livereload
Expand Down

1 comment on commit 109d8b3

@davidalger
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves #63

Please sign in to comment.