etc-configs/nginx/sites-available/zzls.xyz.conf
2023-04-02 22:58:52 -04:00

55 lines
1.3 KiB
Text
Executable file

server {
root /var/www/website;
index index.html index.htm index.nginx-debian.html;
server_name zzls.xyz www.zzls.xyz;
include configs/general.conf;
include configs/securityheaders.conf;
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://matrix.zzls.xyz"}}';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
location /.well-known/matrix/server {
return 200 '{"m.server": "matrix.zzls.xyz:443"}';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
location / {
try_files $uri $uri/ =404;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/zzls.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/zzls.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.zzls.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = zzls.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name zzls.xyz www.zzls.xyz;
listen 80;
return 404; # managed by Certbot
}