events { worker_connections 1024; } http { server { listen 8081; location / { root /srv/; add_header Access-Control-Allow-Origin "*"; } } server { listen 8080 ssl http2; keepalive_timeout 70; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; ssl_ciphers HIGH:!aNULL:!MD5:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers on; ssl_certificate /etc/letsencrypt/live/terminaldweller.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/terminaldweller.com/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; add_header Content-Security-Policy "default-src 'self';"; add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "no-referrer"; sendfile on; tcp_nopush on; # curl https://fosstodon.org/.well-known/webfinger?resource=acct:terminaldweller@fosstodon.org location /.well-known/webfinger { add_header Access-Control-Allow-Origin "*"; add_header Content-Type "application/json"; alias /srv/.well-known/webfinger/finger.json; } # https://metacode.biz/openpgp/web-key-directory? location /.well-known/openpgpkey/hu/ojxfrmdxrz4pm3hh16s5149w5b8acbsn { alias /srv/.well-known/openpgpkey/hu/gpg_pubkey.asc; add_header Access-Control-Allow-Origin "*"; } location /.well-known/openpgpkey/policy { alias /srv/.well-known/openpgpkey/policy; add_header Access-Control-Allow-Origin "*"; } # synapse location /.well-known/matrix/server { access_log off; add_header Access-Control-Allow-Origin "*"; default_type application/json; return 200 '{"m.server": "matrix.terminaldweller.com:443"}'; } location /.well-known/matrix/client { access_log off; add_header Access-Control-Allow-Origin "*"; default_type application/json; return 200 '{"m.homeserver": {"base_url": "https://matrix.terminaldweller.com"}}'; } # pleroma location = /.well-known/host-meta { return 301 https://pleroma.terminaldweller.com$request_uri; } location / { root /srv/; add_header Access-Control-Allow-Origin "*"; add_header Content-Disposition "inline"; } } }