Skip to content

Commit

Permalink
Add X-Cache-Enabled HTTP header.
Browse files Browse the repository at this point in the history
  • Loading branch information
strarsis committed Mar 15, 2024
1 parent 36c8491 commit 5ae8946
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion roles/wordpress-setup/templates/wordpress-site.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# {{ ansible_managed }}

{% block server_before %}{% endblock %}
{% block server_before %}
map $upstream_cache_status $header_x_cache_enabled {
default true;
BYPASS "";
}
{% endblock %}

server {
{% block server_id -%}
Expand All @@ -19,6 +24,9 @@ server {
index index.php index.htm index.html;
add_header Fastcgi-Cache $upstream_cache_status;

# Extra header for WordPress (notably its Site Health check)
add_header X-Cache-Enabled $header_x_cache_enabled;

# Specify a charset
charset utf-8;

Expand Down

0 comments on commit 5ae8946

Please sign in to comment.