Files
homepage/docker/server/nginx.conf
Tom Alexander 0994de6055
Some checks failed
build-staging Build build-staging has failed
Add support for building the site via nix.
2026-07-12 17:26:23 -04:00

86 lines
2.2 KiB
Nginx Configuration File

# user web;
worker_processes 4;
# Speed up regular expressions.
pcre_jit on;
error_log stderr debug;
events {
# Connections per worker process.
worker_connections 1024;
}
http {
include @mime_types@;
default_type application/octet-stream;
types {
text/plain asc;
}
server_tokens off;
client_max_body_size 1m;
sendfile on;
tcp_nopush on;
include @headers_include@;
server {
listen 8080;
root @web_root@;
location / {
try_files $uri $uri/ =404;
autoindex on;
index index.html index.htm;
if (-d $request_filename) {
rewrite [^/]$ $http_x_forwarded_proto://$http_host$uri/ redirect;
}
}
location /healthz {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"OK"}';
}
location /.well-known/ {
alias @web_root@/well-known/;
default_type text/plain;
}
location /.well-known/openpgpkey/hu/ {
alias @web_root@/well-known/openpgpkey/fizz.buzz/hu/;
default_type "application/octet-stream";
add_header Access-Control-Allow-Origin * always;
}
location /.well-known/openpgpkey/policy {
alias @web_root@/well-known/openpgpkey/fizz.buzz/policy;
default_type "application/octet-stream";
add_header Access-Control-Allow-Origin * always;
}
location ~ /\.well-known/(?<path>openpgpkey/[^/]+/hu/.*) {
alias @web_root@/well-known/$path;
default_type "application/octet-stream";
add_header Access-Control-Allow-Origin * always;
}
location /.well-known/matrix/server {
default_type application/json;
add_header "Access-Control-Allow-Origin" *;
return 200 '{"m.server": "matrix.fizz.buzz:8448"}';
}
location /.well-known/matrix/client {
default_type application/json;
add_header "Access-Control-Allow-Origin" *;
return 200 '{"m.homeserver":{"base_url": "https://matrix.fizz.buzz"}}';
}
}
}