2015-05-28 11:32:57 +02:00
|
|
|
# Configuration file for varnish
|
|
|
|
#
|
|
|
|
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
|
|
|
|
# to be set from this shell script fragment.
|
|
|
|
#
|
2015-05-31 19:35:38 +02:00
|
|
|
{% if varnish_enabled %}
|
|
|
|
START=yes
|
|
|
|
{% else %}
|
|
|
|
START=no
|
|
|
|
{% endif %}
|
2015-05-28 11:32:57 +02:00
|
|
|
# Set this to 1 to make systemd reload try to switch vcl without restart.
|
|
|
|
RELOAD_VCL=1
|
|
|
|
|
|
|
|
# Maximum number of open files (for ulimit -n)
|
2015-07-13 14:17:42 +02:00
|
|
|
NFILES={{ varnish_n_files }}
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
# Maximum locked memory size (for ulimit -l)
|
|
|
|
# Used for locking the shared memory log in memory. If you increase log size,
|
|
|
|
# you need to increase this number as well
|
2015-07-13 14:17:42 +02:00
|
|
|
MEMLOCK={{ varnish_memlock }}
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
# Default varnish instance name is the local nodename. Can be overridden with
|
|
|
|
# the -n switch, to have more instances on a single server.
|
2015-07-13 14:17:42 +02:00
|
|
|
INSTANCE={{ varnish_instance_name }}
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
## Alternative 3, Advanced configuration
|
|
|
|
#
|
|
|
|
# See varnishd(1) for more information.
|
|
|
|
#
|
|
|
|
# # Main configuration file. You probably want to change it :)
|
2015-07-13 14:17:42 +02:00
|
|
|
VARNISH_VCL_CONF={{ varnish_vcl_conf }}
|
2015-05-28 11:32:57 +02:00
|
|
|
#
|
|
|
|
# # Default address and port to bind to
|
|
|
|
# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
|
|
|
|
# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
|
|
|
|
# VARNISH_LISTEN_ADDRESS=
|
|
|
|
VARNISH_LISTEN_PORT={{ varnish_listen_port }}
|
|
|
|
#
|
|
|
|
# # Telnet admin interface listen address and port
|
2015-07-13 14:17:42 +02:00
|
|
|
VARNISH_ADMIN_LISTEN_ADDRESS={{ varnish_admin_listen_host }}
|
|
|
|
VARNISH_ADMIN_LISTEN_PORT={{ varnish_admin_listen_port }}
|
2015-05-28 11:32:57 +02:00
|
|
|
#
|
|
|
|
# Shared secret file for admin interface
|
2015-07-13 14:17:42 +02:00
|
|
|
VARNISH_SECRET_FILE={{ varnish_secret_file }}
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
# # The minimum number of worker threads to start
|
2015-05-31 19:35:38 +02:00
|
|
|
VARNISH_MIN_THREADS={{ varnish_min_threads }}
|
2015-05-28 11:32:57 +02:00
|
|
|
#
|
|
|
|
# # The Maximum number of worker threads to start
|
2015-05-31 19:35:38 +02:00
|
|
|
VARNISH_MAX_THREADS={{ varnish_max_threads }}
|
2015-05-28 11:32:57 +02:00
|
|
|
#
|
|
|
|
# # Idle timeout for worker threads
|
2015-07-13 14:17:42 +02:00
|
|
|
VARNISH_THREAD_TIMEOUT={{ varnish_thread_timeout }}
|
2015-05-28 11:32:57 +02:00
|
|
|
#
|
|
|
|
# # Cache file location
|
|
|
|
VARNISH_STORAGE_FILE={{ varnish_storage_file }}
|
|
|
|
#
|
|
|
|
# # Cache file size: in bytes, optionally using k / M / G / T suffix,
|
|
|
|
# # or in percentage of available disk space using the % suffix.
|
|
|
|
VARNISH_STORAGE_SIZE={{ varnish_storage_size }}
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# # Backend storage specification
|
|
|
|
VARNISH_STORAGE="file,{{ varnish_storage_file }},{{ varnish_storage_size }}"
|
|
|
|
#
|
|
|
|
# # Default TTL used when the backend does not specify one
|
|
|
|
VARNISH_TTL={{ varnish_ttl }}
|
|
|
|
#
|
|
|
|
# User and group for the varnishd worker processes
|
|
|
|
VARNISH_USER={{ varnish_user }}
|
|
|
|
VARNISH_GROUP={{ varnish_group }}
|
2015-05-31 19:35:38 +02:00
|
|
|
#
|
2015-07-13 14:17:42 +02:00
|
|
|
DAEMON_OPTS="-a :{{ varnish_listen_port }} -P {{ varnish_pid_file }} -f {{ varnish_vcl_conf }} -T {{ varnish_admin_listen_host }}:{{ varnish_admin_listen_port }} -t {{ varnish_ttl }} -p thread_pool_min={{ varnish_min_threads }} -p thread_pool_max={{ varnish_max_threads }} -p thread_pool_timeout={{ varnish_thread_timeout }} -S {{ varnish_secret_file }} -n {{ varnish_instance_name }} {% if varnish_use_disk_cache %}-s file,{{ varnish_storage_file }},{{ varnish_storage_size }}{% endif %} {% if varnish_use_ram_cache %}-s malloc,{{ varnish_ram_cache_size }}{% endif %}"
|