wiki_ghostguild/nginx.conf
Jennie Robinson Faber 289e673cbc Replace Nuxt wiki with Outline deployment config
Strip the Nuxt 4 static site and replace with Docker Compose config
for self-hosted Outline wiki (Outline + PostgreSQL 16 + Redis 7).
Adds nginx reverse proxy with WebSocket support and CSS injection,
migration script for existing markdown articles, backup script,
and starter theme CSS.
2026-03-01 15:45:44 +00:00

80 lines
2.3 KiB
Nginx Configuration File

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 50M;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript
application/javascript application/json
application/xml+rss image/svg+xml;
upstream outline {
server 127.0.0.1:3100;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name wiki.ghostguild.org;
# Serve custom theme files
location /custom/ {
alias /opt/ghost-guild-wiki-theme/;
expires 1h;
add_header Cache-Control "public";
}
# Health check
location = /api/health {
proxy_pass http://outline;
access_log off;
}
# Reverse proxy to Outline with CSS injection
location / {
proxy_pass http://outline;
# Standard proxy headers
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;
# Disable encoding so sub_filter can process the response
proxy_set_header Accept-Encoding "";
# WebSocket support (required for real-time collaboration)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Inject custom CSS before </head>
sub_filter '</head>' '<link rel="stylesheet" href="/custom/ghost-guild.css" /></head>';
sub_filter_once on;
sub_filter_types text/html;
}
}
}