{%- if prefer_gzip and not (slave_type == 'zope' and backend_url) %}
rewrite {
rewrite {
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
to /prefer-gzip{uri}
to /prefer-gzip{uri}
}
}
{%- endif %} {#- if prefer_gzip #}
{%- endif %} {#- if prefer_gzip and not (slave_type == 'zope' and backend_url) #}
{%- if slave_type == 'zope' and backend_url %}
{%- if slave_type == 'zope' and backend_url %}
# Zope configuration
# Zope configuration
...
@@ -90,10 +90,18 @@
...
@@ -90,10 +90,18 @@
/ {scheme}://{host}/{{ default_path }}
/ {scheme}://{host}/{{ default_path }}
} {# redir #}
} {# redir #}
{%- endif %} {#- if default_path #}
{%- endif %} {#- if default_path #}
{%- if prefer_gzip %}
rewrite {
regexp (.*)
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
to /prefer-gzip/VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-https-port', '443') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
}
{%- else %}
rewrite {
rewrite {
regexp (.*)
regexp (.*)
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-https-port', '443') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-https-port', '443') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
} {# rewrite #}
} {# rewrite #}
{%- endif %} {#- if prefer_gzip #}
{%- elif slave_type == 'redirect' and backend_url %} {#- if slave_type == 'zope' and backend_url #}
{%- elif slave_type == 'redirect' and backend_url %} {#- if slave_type == 'zope' and backend_url #}
{%- if prefer_gzip and not (slave_type == 'zope' and backend_url) %}
rewrite {
rewrite {
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
to /prefer-gzip{uri}
to /prefer-gzip{uri}
}
}
{%- endif %} {#- if prefer_gzip #}
{%- endif %} {#- if prefer_gzip and not (slave_type == 'zope' and backend_url) #}
{%- if https_only %}
{%- if https_only %}
# Enforced redirection to SSL-enabled host
# Enforced redirection to SSL-enabled host
...
@@ -211,10 +219,18 @@
...
@@ -211,10 +219,18 @@
/ {scheme}://{host}/{{ default_path }}
/ {scheme}://{host}/{{ default_path }}
} {# redir #}
} {# redir #}
{%- endif %} {#- if default_path #}
{%- endif %} {#- if default_path #}
{%- if prefer_gzip %}
rewrite {
regexp (.*)
if {>Accept-Encoding} match "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)"
to /prefer-gzip/VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-http-port', '80') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
}
{%- else %}
rewrite {
rewrite {
regexp (.*)
regexp (.*)
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-http-port', '80') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-http-port', '80') | int }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}