From 1b59608ff71e3dd4f805268dbf6f977c027b6ee3 Mon Sep 17 00:00:00 2001 From: Patrick Schwarz Date: Tue, 20 Jan 2026 00:59:56 +0100 Subject: [PATCH] Add nginx sample --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index aa35d52..9394b37 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,57 @@ document.addEventListener("DOMContentLoaded", function () { #hackcal [data-uid] span:first-child {flex: 0 0 3em; font-weight: bold} ``` +## Sample nginx config +``` +server { + listen 80; + listen [::]:80; + server_name hackcal.mydomain.example; + + # Path to the root of your installation + root /var/www/hackcal; + + # Charset + charset UTF-8; + + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; + + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + index index.php; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_pass php-handler; + + fastcgi_cache phpcache; + fastcgi_cache_valid 1m; + fastcgi_cache_use_stale error timeout updating invalid_header http_500 http_503; + fastcgi_cache_min_uses 1; + fastcgi_cache_lock on; + add_header X-FastCGI-Cache $upstream_cache_status; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + # Serve filtered calendar.ics + location = /mycalendar.ics { + rewrite ^ /cache/index.php last; + } + +} +``` +