Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🚀
Back to work

VirtuBox VirtuBox

🚀
Back to work
View GitHub Profile
@VirtuBox
VirtuBox / http3.conf
Last active May 31, 2024 08:58
HTTP/3 QUIC conf with more_set_headers
more_set_headers "X-protocol : $server_protocol always";
more_set_headers 'Alt-Svc h3=":$server_port"; ma=86400';
quic_retry on;
listen 443 quic;
listen 443 ssl;
listen [::]:443 quic;
listen [::]:443 ssl;
@VirtuBox
VirtuBox / nginx.conf
Last active April 19, 2024 07:46
Secure nginx.conf
##
# Common security rules
##
# Security settings for better privacy
# Deny hidden files
location ~ /\.(?!well-known\/) {
deny all;
}
# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) or other common git repository files
@VirtuBox
VirtuBox / nginx.conf
Created April 19, 2024 07:35
optimized nginx.conf
user www-data;
# # The special value auto allows binding worker processes automatically to available CPUs:
worker_processes auto;
worker_cpu_affinity auto;
# # Changes the limit on the maximum number of open files (RLIMIT_NOFILE) for worker processes
worker_rlimit_nofile 100000;
pid /run/nginx.pid;
# # PCRE JIT can speed up processing of regular expressions significantly.
pcre_jit on;
@VirtuBox
VirtuBox / wsl-vpnkit.sh
Last active November 17, 2023 13:13
Script to install wsl-vpnkit with a systemd service for Debian/Ubuntu
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# wsl-vpnkit install script
# -------------------------------------------------------------------------
# Check if user is root
[ "$(id -u)" != "0" ] && {
echo "Error: You must be root or use sudo to run this script"
exit 1
}
@VirtuBox
VirtuBox / selfsigned.sh
Created February 6, 2023 21:03
Generate Self-signed certificate
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# Generate Self-signed certificate
# -------------------------------------------------------------------------
# Usage :
#
# bash selfsigned.sh <domain>
#
# -------------------------------------------------------------------------
@VirtuBox
VirtuBox / matomo.conf
Created February 4, 2023 11:57
matomo wordops conf
location ~ /(config|tmp|core|lang|libs|vendor|plugins|misc/user)$ {
deny all;
}
add_header Referrer-Policy origin;
add_header X-Piwik-Cache $upstream_cache_status;
location ~* \.html$ {
allow all;
}
@VirtuBox
VirtuBox / brotli.sh
Created January 9, 2023 17:59
Enable brotli on WordOps
sudo mv /etc/nginx/conf.d/brotli.conf.disabled /etc/nginx/conf.d/brotli.conf
sudo mv /etc/nginx/conf.d/gzip.conf /etc/nginx/conf.d/gzip.conf.disabled
sudo nginx -t && sudo service nginx restart
@VirtuBox
VirtuBox / ssl.conf
Last active October 25, 2022 14:16
Host a site available on hostname:port or localhost:port
# file /var/www/site.tld/conf/nginx/ssl.conf
# Here Nginx list on port 1443 instead of 443
listen 1443 ssl http2;
listen [::]:1443 ssl http2;
ssl_certificate /etc/letsencrypt/live/site.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.tld/key.pem;
ssl_trusted_certificate /etc/letsencrypt/live/site.tld/ca.pem;
@VirtuBox
VirtuBox / sources.list
Created August 14, 2020 10:18
Ubuntu focal official repo [FR]
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU Xenial REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://fr.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
###### Ubuntu Update Repos
deb http://fr.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
@VirtuBox
VirtuBox / nextcloud.conf
Created July 15, 2020 13:52
wordops nextcloud
# WordOps nextcloud configuration
# install path : /var/www/yourdomain.tld/conf/nginx/nextcloud.conf
# replace "fastcgi_pass php73;" with another upstream if you are using php72 or php74
# ----------------------------------------------------------------------------
add_header X-Robots-Tag none;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
location = /robots.txt {
allow all;