default.conf (1786B)
1 limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; 2 limit_conn_zone $binary_remote_addr zone=addr:10m; 3 server { 4 listen 8080; 5 server_name _; 6 7 root /usr/share/nginx/html; 8 index index.html; 9 10 limit_conn addr 10; 11 12 # Security headers 13 add_header X-Content-Type-Options nosniff; 14 add_header X-Frame-Options DENY; 15 add_header X-XSS-Protection "1; mode=block"; 16 17 # wkd specific configuration 18 location /.well-known/openpgpkey/hu/p6d5q6ozbrkcy3cnexq8s8uzh1rk9fbs { 19 limit_req zone=one burst=20 nodelay; 20 add_header Content-Type "application/octet-stream; charset=utf-8"; 21 add_header Cache-Control "max-age=604800"; 22 try_files $uri =404; 23 } 24 location /.well-known/openpgpkey/nordgedanken.dev/hu/p6d5q6ozbrkcy3cnexq8s8uzh1rk9fbs { 25 limit_req zone=one burst=20 nodelay; 26 add_header Content-Type "application/octet-stream; charset=utf-8"; 27 add_header Cache-Control "max-age=604800"; 28 try_files $uri =404; 29 } 30 location /.well-known/openpgpkey/policy { 31 limit_req zone=one burst=20 nodelay; 32 add_header Content-Type text/plain; 33 return 200 ""; 34 } 35 location / { 36 limit_req zone=one burst=20 nodelay; 37 add_header Content-Type text/plain; 38 return 200 "OK"; 39 } 40 41 # Tell synapse to not look for a matrix server here 42 location /.well-known/matrix/server { 43 limit_req zone=one burst=20 nodelay; 44 return 410; 45 } 46 location /_matrix { 47 limit_req zone=one burst=20 nodelay; 48 return 410; 49 } 50 51 # Health check endpoint 52 location /health { 53 access_log off; 54 add_header Content-Type text/plain; 55 return 200 "healthy"; 56 } 57 58 # Disable server tokens 59 server_tokens off; 60 }