home · contact · privacy
To microblog.pub NGINX setup, add gzip compression.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 5 Jan 2023 22:47:52 +0000 (23:47 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 5 Jan 2023 22:47:52 +0000 (23:47 +0100)
bullseye/etc_files/microblogpub/etc/nginx/sites-available/microblogpub.nginx

index 36e2447f3c4cbf4d36438d4342c3e7b617336345..148a494a602e85da3023612488b0a347860ca775 100644 (file)
@@ -5,6 +5,43 @@ server {
     ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
 
     ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
 
+    // via <https://www.digitalocean.com/community/tutorials/how-to-improve-website-performance-using-gzip-and-nginx-on-ubuntu-20-04>
+    // and https://docs.microblog.pub/installing.html#nginx-config-tips
+    gzip on;
+    gzip_disable "msie6";
+    gzip_vary on;
+    gzip_proxied any;
+    gzip_comp_level 6;
+    gzip_buffers 16 8k;
+    gzip_http_version 1.1;
+    gzip_min_length 256;
+    gzip_types
+      application/atom+xml
+      application/geo+json
+      application/javascript
+      application/x-javascript
+      application/json
+      application/ld+json
+      application/manifest+json
+      application/rdf+xml
+      application/rss+xml
+      application/xhtml+xml
+      application/xml
+      font/eot
+      font/otf
+      font/ttf
+      image/svg+xml
+      text/css
+      text/javascript
+      text/plain
+      text/xml
+
+      text/html
+
+      application/javascript
+      application/activity+json
+      application/octet-stream;
+
     location / {
       proxy_set_header Host $http_host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     location / {
       proxy_set_header Host $http_host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;