meson / p.meson.kr

Last active 3 weeks ago

Like 0

meson revised this gist 3 weeks ago · ec06005

1 file changed, 68 insertions

p.meson.kr (file created)
@@ -0,0 +1,68 @@
1 + server {
2 + listen 80;
3 + listen [::]:80;
4 + server_name p.meson.kr;
5 +
6 + return 301 https://$host$request_uri;
7 + }
8 +
9 + server {
10 + # HTTP/2 over TCP
11 + listen 443 ssl;
12 + listen [::]:443 ssl;
13 +
14 + # HTTP/3 over QUIC/UDP
15 + listen 443 quic;
16 + listen [::]:443 quic;
17 +
18 + http2 on;
19 + http3 on;
20 +
21 + add_header Alt-Svc 'h3=":443"; ma=86400' always;
22 +
23 + server_name p.meson.kr;
24 + root /home/www-data/p.meson.kr;
25 +
26 + include /etc/letsencrypt/options-ssl-nginx.conf;
27 +
28 + ssl_certificate /etc/letsencrypt/live/p.meson.kr/fullchain.pem;
29 + ssl_certificate_key /etc/letsencrypt/live/p.meson.kr/privkey.pem;
30 +
31 + # Security Headers
32 + add_header X-Frame-Options "SAMEORIGIN" always;
33 + add_header X-XSS-Protection "1; mode=block" always;
34 + add_header X-Content-Type-Options "nosniff" always;
35 + add_header Referrer-Policy "no-referrer-when-downgrade" always;
36 + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
37 +
38 + # Max upload size (Important if allowing large file attachments in pastes)
39 + client_max_body_size 32M;
40 +
41 + access_log /var/log/nginx/privatebin_access.log;
42 + error_log /var/log/nginx/privatebin_error.log;
43 +
44 + location / {
45 + proxy_pass http://127.0.0.1:6158;
46 +
47 + proxy_set_header Host $host;
48 + proxy_set_header X-Real-IP $remote_addr;
49 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50 + proxy_set_header X-Forwarded-Proto $scheme;
51 +
52 + # Clear out buffer restrictions for instant file uploads
53 + proxy_buffering off;
54 + }
55 +
56 + location ~ /\.(?!well-known) {
57 + deny all;
58 + access_log off;
59 + log_not_found off;
60 + }
61 +
62 + location ~* \.(env|log|git|yaml|yml|json)$ {
63 + deny all;
64 + access_log off;
65 + log_not_found off;
66 + }
67 +
68 + }