From fe21d913df2467754c549087df91a44dfffb81e7 Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Sat, 30 May 2020 20:12:02 +0100
Subject: [PATCH] Add nginx cache
---
gemini/EN/install.gmi | 5 +++++
website/EN/index.html | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/gemini/EN/install.gmi b/gemini/EN/install.gmi
index cd16a9a6..8efaae72 100644
--- a/gemini/EN/install.gmi
+++ b/gemini/EN/install.gmi
@@ -56,6 +56,8 @@ Create a web server configuration:
And paste the following:
+ proxy_cache_path /var/www/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
+ inactive=60m use_temp_path=off;
server {
listen 80;
listen [::]:80;
@@ -122,6 +124,8 @@ And paste the following:
proxy_redirect off;
proxy_request_buffering on;
proxy_buffering on;
+ proxy_cache my_cache;
+ proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://localhost:7156;
}
}
@@ -129,6 +133,7 @@ And paste the following:
Enable the site:
ln -s /etc/nginx/sites-available/YOUR_DOMAIN /etc/nginx/sites-enabled/
+ mkdir /var/www/cache
Forward port 443 from your internet router to your server. If you have dynamic DNS make sure its configured. Add a TLS certificate:
diff --git a/website/EN/index.html b/website/EN/index.html
index 5ba99921..3571114a 100644
--- a/website/EN/index.html
+++ b/website/EN/index.html
@@ -1335,6 +1335,9 @@
And paste the following:
+ proxy_cache_path /var/www/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
+ inactive=60m use_temp_path=off;
+
server {
listen 80;
listen [::]:80;
@@ -1401,6 +1404,8 @@
proxy_redirect off;
proxy_request_buffering on;
proxy_buffering on;
+ proxy_cache my_cache;
+ proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://localhost:7156;
}
}
@@ -1410,7 +1415,8 @@
Enable the site:
- ln -s /etc/nginx/sites-available/YOUR_DOMAIN /etc/nginx/sites-enabled/
+ ln -s /etc/nginx/sites-available/YOUR_DOMAIN /etc/nginx/sites-enabled/
+ mkdir /var/www/cache