commit 2a57f40199d9be0d97655126b6b228d9ed1261cf Author: Myve Date: Fri Jun 14 07:14:42 2024 +0000 First commit diff --git a/http_upgrade b/http_upgrade new file mode 100644 index 0000000..449001e --- /dev/null +++ b/http_upgrade @@ -0,0 +1,27 @@ +# Security +server_tokens off; +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" always; +add_header X-Permitted-Cross-Domain-Policies "none" always; +add_header X-Robots-Tag "noindex, nofollow" always; +# CSP breaks some webapps +# add_header Content-Security-Policy "default-src 'self';" always; + +# http2 +http2 on; + +# http3 +# Open port 443/udp to use http3 +# Add reuseport to ONLY ONE virtual host: listen 443 quic reuseport; +listen 443 quic; +add_header Alt-Svc 'h3=":443"; ma=86400'; +quic_retry on; +http3 on; + +# Certbot defaults +listen 443 ssl; +include /etc/letsencrypt/options-ssl-nginx.conf; +ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +add_header Strict-Transport-Security "max-age=31536000" always; diff --git a/nginx.sh b/nginx.sh new file mode 100644 index 0000000..5d356fb --- /dev/null +++ b/nginx.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Fill in the following variables +appname= +url= +domain= +port= +eff_email_address= + +# .conf installation +{ + +# Exit if variables are null +if [ -z ${appname} ] || [ -z ${url} ] || [ -z ${domain} ] || [ -z ${port} ] || [ -z ${eff_email_address} ] +then + exit 1 +fi + +sudo tee /etc/nginx/sites-available/${appname}.conf >/dev/null <