summaryrefslogtreecommitdiff
path: root/examples/nginx/witryna.conf
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nginx/witryna.conf')
-rw-r--r--examples/nginx/witryna.conf48
1 files changed, 48 insertions, 0 deletions
diff --git a/examples/nginx/witryna.conf b/examples/nginx/witryna.conf
new file mode 100644
index 0000000..5f56ef2
--- /dev/null
+++ b/examples/nginx/witryna.conf
@@ -0,0 +1,48 @@
+# witryna.conf — Nginx reverse proxy configuration for Witryna
+#
+# Two server blocks:
+# 1. Public site — serves the built static assets
+# 2. Webhook endpoint — proxies deploy triggers to Witryna
+#
+# TLS is not configured here — use certbot or similar to add certificates:
+# sudo certbot --nginx -d my-site.example.com -d witryna.example.com
+
+# Public site — serves your built static files
+server {
+ listen 80;
+ server_name my-site.example.com;
+
+ root /var/lib/witryna/builds/my-site/current;
+ index index.html;
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+
+ # Security headers
+ add_header X-Frame-Options "DENY" always;
+ add_header X-Content-Type-Options "nosniff" always;
+ add_header Referrer-Policy "strict-origin-when-cross-origin" always;
+}
+
+# Webhook endpoint — reverse proxy to Witryna
+server {
+ listen 80;
+ server_name witryna.example.com;
+
+ # Only allow POST requests
+ location / {
+ limit_except POST {
+ deny all;
+ }
+
+ proxy_pass http://127.0.0.1:8080;
+ proxy_set_header Host $host;
+ 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;
+ }
+
+ # Security headers
+ add_header X-Content-Type-Options "nosniff" always;
+}