2022-06-08 22:34:50 +02:00
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
|
|
|
|
user www-data;
|
|
|
|
worker_processes auto;
|
|
|
|
pid /run/nginx.pid;
|
|
|
|
include /etc/nginx/modules-enabled/*.conf;
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 768;
|
|
|
|
#worker_processes auto; # <- default is 1
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
sendfile on;
|
|
|
|
tcp_nopush on;
|
|
|
|
types_hash_max_size 2048;
|
|
|
|
server_tokens off;
|
|
|
|
|
|
|
|
server_name_in_redirect off;
|
|
|
|
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
|
|
|
|
gzip off; # compression and crypto don't mix
|
|
|
|
# include /etc/nginx/conf.d/*.conf; # Ansible
|
2022-06-19 22:40:12 +02:00
|
|
|
|
|
|
|
include /etc/nginx/snippets/connection_upgrade.conf;
|
|
|
|
|
2022-06-08 22:34:50 +02:00
|
|
|
include /etc/nginx/sites-enabled/*;
|
|
|
|
}
|
|
|
|
|
|
|
|
stream {
|
|
|
|
include /etc/nginx/stream_rp.conf;
|
|
|
|
|
2022-06-22 22:45:05 +02:00
|
|
|
# Map the SNI from the TLS hello packet to an upstream server.
|
|
|
|
# This allow to RP request without breaking the TLS encryption
|
|
|
|
# like a proxy_pass does
|
|
|
|
map $ssl_preread_server_name $upstream_server {
|
|
|
|
acme-v02.api.letsencrypt.org acme;
|
|
|
|
r3.o.lencr.org r3;
|
|
|
|
default self;
|
|
|
|
}
|
|
|
|
|
|
|
|
# let's encrypt servers, to generate LE cert from isolated network
|
|
|
|
upstream acme {
|
|
|
|
server acme-v02.api.letsencrypt.org:443;
|
|
|
|
}
|
|
|
|
upstream r3 {
|
|
|
|
server r3.o.lencr.org:443;
|
|
|
|
}
|
|
|
|
# default to this server sites
|
|
|
|
upstream self {
|
|
|
|
server 127.0.0.1:8443;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 0.0.0.0:443;
|
|
|
|
proxy_pass $upstream_server;
|
|
|
|
ssl_preread on;
|
|
|
|
}
|
2022-06-08 22:34:50 +02:00
|
|
|
}
|