blob: cbe06ce26f2bff63d4c08819b74a07bda12a6f89 (
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
|
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
worker_cpu_affinity auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
limit_req_zone $binary_remote_addr zone=etherpad_req:10m rate=10r/s;
limit_conn_zone $binary_remote_addr zone=etherpad_conn:10m;
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
server_tokens off; # Recommended practice is to turn this off
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3 (POODLE), TLS 1.0, 1.1
ssl_prefer_server_ciphers off; # Don't force server cipher order.
##
# Logging Settings
##
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/vhost.access.log vhost;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
# configuration file /etc/nginx/mime.types:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xslt+xml xsl xslt;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/ogg ogv;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-matroska mkv;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
# configuration file /etc/nginx/conf.d/connection-upgrade-map.conf:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# configuration file /etc/nginx/sites-enabled/bin.labunix.xyz-9443.conf:
server {
listen 443 ssl;
http2 on;
server_name bin.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
client_max_body_size 50m;
location / {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
# configuration file /etc/nginx/sites-enabled/cloud-wg.conf:
server {
listen 443 ssl;
http2 on;
server_name cloud.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
client_max_body_size 2G;
location / {
proxy_pass http://127.0.0.1:9091; # adjust if your upstream differs
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# configuration file /etc/nginx/sites-enabled/etherpad:
server {
listen 443 ssl;
http2 on;
server_name ether.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
limit_req zone=etherpad_req burst=60 nodelay;
limit_conn etherpad_conn 20;
client_max_body_size 1m;
# Admin only (protect both /admin and /admin/)
location = /admin {
auth_basic "Etherpad Admin";
auth_basic_user_file /etc/nginx/htpasswd-etherpad-admin;
proxy_pass http://127.0.0.1:9001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_buffering off;
}
location ^~ /admin/ {
auth_basic "Etherpad Admin";
auth_basic_user_file /etc/nginx/htpasswd-etherpad-admin;
proxy_pass http://127.0.0.1:9001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_buffering off;
}
location / {
proxy_pass http://127.0.0.1:9001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_buffering off;
}
}
# configuration file /etc/nginx/sites-enabled/labunix-i2p.conf:
server {
listen 127.0.0.1:8089;
listen [::1]:8089;
server_name _;
root /srv/www/labunix/public;
index index.html;
access_log /var/log/nginx/labunix-i2p.access.log;
error_log /var/log/nginx/labunix-i2p.error.log;
location / {
try_files $uri $uri/ =404;
}
}
# configuration file /etc/nginx/sites-enabled/labunix-onion.conf:
server {
listen 127.0.0.1:8088;
server_name _;
root /srv/www/labunix/public;
index index.html;
access_log /var/log/nginx/labunix-onion.access.log;
error_log /var/log/nginx/labunix-onion.error.log;
location / {
try_files $uri $uri/ =404;
}
location ~* \.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
try_files $uri =404;
}
}
# configuration file /etc/nginx/sites-enabled/labunix.conf:
# HTTP on :9080 (optional: redirect to HTTPS :9443)
server {
listen 9080;
server_name labunix.xyz www.labunix.xyz 10.50.0.1;
# If you want redirect to HTTPS on :9443:
return 301 https://$host:443$request_uri;
# If you prefer serving plain HTTP instead, comment the return above
# and uncomment this:
# root /srv/www/labunix/public;
# index index.html;
# location / { try_files $uri $uri/ =404; }
}
# HTTPS on :9443
server {
listen 443 ssl;
http2 on;
server_name labunix.xyz www.labunix.xyz 10.50.0.1;
root /srv/www/labunix/public;
index index.html;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
add_header Onion-Location "http://l6xtdi33ubszm2gswstchrb6o4d6aw3ewj2irexlsbzk6pvesky7p2ad.onion$request_uri" always;
location / {
try_files $uri $uri/ =404;
}
location /stats/ {
alias /srv/stats/;
index goaccess.html;
allow 127.0.0.1;
allow 10.50.0.0/24;
allow 192.168.33.0/24;
deny all;
}
location ~* \.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
try_files $uri =404;
}
}
# configuration file /etc/nginx/sites-enabled/lufi.conf:
server {
listen 443 ssl;
http2 on;
server_name lufi.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/lufi.htpasswd;
access_log /var/log/nginx/vhost.access.log vhost;
error_log /var/log/nginx/lufi.error.log;
location / {
proxy_pass http://127.0.0.1:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header X-Frame-Options SAMEORIGIN always;
add_header X-Content-Type-Options nosniff always;
client_max_body_size 2G;
proxy_read_timeout 3600s;
}
}
# configuration file /etc/nginx/sites-enabled/pad.labunix.xyz-9443.conf:
# pad.labunix.xyz (main) → HTTP:3101, WS:3103
server {
listen 443 ssl;
http2 on;
server_name pad.labunix.xyz;
access_log /var/log/nginx/vhost.access.log vhost;
ssl_certificate /etc/letsencrypt/live/pad.labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pad.labunix.xyz/privkey.pem;
client_max_body_size 100m;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd-cryptpad;
location /cryptpad_websocket {
proxy_pass http://127.0.0.1:3103;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
proxy_pass http://127.0.0.1:3101;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# pad-sandbox.labunix.xyz (sandbox) → HTTP:3101, WS:3103
server {
listen 443 ssl;
http2 on;
server_name pad-sandbox.labunix.xyz;
access_log /var/log/nginx/vhost.access.log vhost;
ssl_certificate /etc/letsencrypt/live/pad.labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pad.labunix.xyz/privkey.pem;
client_max_body_size 100m;
location /cryptpad_websocket {
proxy_pass http://127.0.0.1:3103;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
proxy_pass http://127.0.0.1:3101;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# configuration file /etc/nginx/sites-enabled/pdf.labunix.xyz.conf:
server {
listen 443 ssl;
server_name pdf.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m;
auth_basic "Stirling PDF";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
proxy_pass http://127.0.0.1:9092;
}
}
# configuration file /etc/nginx/sites-enabled/search.labunix.xyz.conf:
limit_req_zone $binary_remote_addr zone=searxng:10m rate=30r/m;
server {
listen 443 ssl;
http2 on;
server_name search.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
location / {
limit_req zone=searxng burst=50 nodelay;
limit_req_status 429;
proxy_pass http://10.50.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
# configuration file /etc/nginx/sites-enabled/upload.labunix.xyz-9443.conf:
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name upload.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
client_max_body_size 21m;
location / {
proxy_pass http://127.0.0.1:5280;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_request_buffering off;
proxy_buffering off;
}
}
# configuration file /etc/nginx/sites-enabled/vault.labunix.xyz-9443.conf:
server {
listen 443 ssl;
server_name vault.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m;
location / {
proxy_pass http://127.0.0.1:9081;
}
# keep only if you publish 127.0.0.1:3012:3012
location /notifications/hub {
proxy_pass http://127.0.0.1:3012;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /notifications/hub/negotiate {
proxy_pass http://127.0.0.1:9081;
}
}
# configuration file /etc/nginx/sites-enabled/wiki.labunix.xyz.conf:
server {
listen 443 ssl;
server_name wiki.labunix.xyz;
ssl_certificate /etc/letsencrypt/live/labunix.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/labunix.xyz/privkey.pem;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m;
location / {
proxy_pass http://127.0.0.1:9093;
}
}
|