# TODO: replace , , and . # in vim use """:%s//replacement/g""" server { listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/letsencrypt/live//fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live//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 root /var/www/; index index.html index.php; server_name ; server_tokens off; # prevent nginx server detection # restrict access to git folder location ~ /\.git { return 404; } location / { try_files $uri $uri/ =404; } location ~ \.php$ { # location ~ \.php(/|$) { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } error_page 404 /404.html; access_log /var/log/nginx/.access.log tabbed_detailed; } server { listen 80; listen [::]:80; server_name ; server_tokens off; # prevent nginx server detection return 301 https://$server_name$request_uri; access_log /var/log/nginx/http.access.log tabbed_detailed; }