Improve lighthouse score by enabling css/js cache and compression

This commit is contained in:
nemunaire 2023-06-29 10:50:09 +02:00
parent aeeffda366
commit 9e7ac3c166

View File

@ -13,6 +13,9 @@
- ansible.builtin.set_fact:
server: |
location / {
gzip on;
gzip_types application/javascript text/javascript text/css;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@ -26,6 +29,10 @@
chunked_transfer_encoding off;
proxy_pass https://storage_nemunaire/{{ bucket }}{{ path }}/;
if ($uri ~ (.css|.js|.jpg|.png|.webp|.ico|.woff|.woff2|.ttf)$) {
expires max;
}
{% for error_page in error_pages %}
error_page {{ error_page }} {{ error_pages[error_page] }};
{% endfor %}