🗝
summary refs log tree commit diff
path: root/nginx/nginx.conf
blob: e3f92c9b10cdb6b4f9f38ae2725c997c697c6b7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;

events {
	worker_connections 1024;
}

http {
	aio threads;
	tcp_nopush on;
	server_tokens off;
	http2 on;

	gzip on;
	gunzip on;
	gzip_vary on;
	gzip_types text/plain text/css application/json application/javascript text/javascript;

	map $http_upgrade $connection_upgrade {
		default upgrade;
		'' close;
	}

	proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=pcache:32m max_size=20g;

	# mozilla ssl settings via https://ssl-config.mozilla.org/

	ssl_session_timeout 1d;
	ssl_session_cache shared:SSL:10m;
	ssl_session_tickets off;

	ssl_protocols TLSv1.3;
	ssl_prefer_server_ciphers off;

	ssl_stapling on;
	ssl_stapling_verify on;
	resolver 127.0.0.53;

	# dummy host
	server {
		listen 443 quic reuseport default_server;
		listen [::]:443 quic reuseport default_server;
		listen 443 ssl reuseport default_server;
		listen [::]:443 ssl reuseport default_server;
		server_name _;
		ssl_certificate /etc/tls/mia.jetzt.crt;
		ssl_certificate_key /etc/tls/mia.jetzt.key;
	}

	# https redirect
	server {
		listen 80 default_server;
		listen [::]:80 default_server;
		server_name _;
		location / {
			return 301 https://$host$request_uri;
		}
	}

	%SERVERS%
}