WIP
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Cat /dev/Nulo 2022-11-17 18:35:26 -03:00
parent 95a43f2c8b
commit a0e50e23c3

View file

@ -1,9 +1,95 @@
modules.nginx = {} modules.nginx = {
add_packages({ "nginx" }) domain_name = "pruebas.nulo.in",
}
add_packages({ "nginx", "nginx-mod-http-brotli" })
modules.fstab.add_tmpfs("/var/lib/nginx/tmp") modules.fstab.add_tmpfs("/var/lib/nginx/tmp")
modules.data.add_data_dir("/data/nginx/logs", "/var/log/nginx", "nginx", "nginx") modules.data.add_data_dir("/data/nginx/logs", "/var/log/nginx", "nginx", "nginx")
modules.runit.add_service("nginx", [[#!/bin/sh modules.runit.add_service("nginx", [[#!/bin/sh
exec 2>&1 exec 2>&1
mkdir -p /run/nginx || exit 1 mkdir -p /run/nginx || exit 1
exec nginx -g 'daemon off;' exec nginx -g 'daemon off;'
]]) ]])
add_file("/etc/nginx/nginx.conf", [[
user nginx;
worker_processes auto;
pcre_jit on;
error_log /var/log/nginx/error.log warn;
include /etc/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
client_max_body_size 1024m;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/ssl/nginx/dh2048.pem;
# https://ssl-config.mozilla.org/#server=nginx&version=1.22.0&config=intermediate&openssl=1.1.1p&guideline=5.6
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 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 off;
ssl_stapling on;
ssl_stapling_verify on;
gzip on;
gzip_vary on;
gzip_types application/atom+xml application/javascript application/json application/rss+xml
application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
brotli on;
brotli_static on;
brotli_types application/atom+xml application/javascript application/json application/rss+xml
application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
# Helper variable for proxying websockets.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
include /etc/nginx/http.d/*.conf;
}
# TIP: Uncomment if you use stream module.
#include /etc/nginx/stream.conf;
]])
-- https://ssl-config.mozilla.org/ffdhe2048.txt
add_file("/etc/ssl/nginx/dh2048.pem", [[-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----]])