-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf.example
More file actions
109 lines (89 loc) · 2.79 KB
/
Copy pathnginx.conf.example
File metadata and controls
109 lines (89 loc) · 2.79 KB
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
# SecBoard Nginx Reverse Proxy Configuration
upstream secboard_backend {
server 127.0.0.1:3131;
keepalive 32;
}
upstream secboard_cast {
server 127.0.0.1:3132;
keepalive 8;
}
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=events_limit:10m rate=30r/s;
server {
listen 80;
server_name yourdomain.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
root /opt/secboard/dist/web;
index index.html;
location ~* \.(js|css|woff2?|ttf|otf|svg|png|jpg|jpeg|webp|gif|ico)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.html;
}
location /rpc/ {
limit_req zone=api_limit burst=20 nodelay;
proxy_pass http://secboard_backend;
proxy_http_version 1.1;
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;
proxy_read_timeout 60s;
}
location /kv/ {
limit_req zone=api_limit burst=20 nodelay;
proxy_pass http://secboard_backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location /ui/ {
limit_req zone=api_limit burst=20 nodelay;
proxy_pass http://secboard_backend;
}
location /ui-state/ {
limit_req zone=api_limit burst=20 nodelay;
proxy_pass http://secboard_backend;
}
location /events {
limit_req zone=events_limit burst=60 nodelay;
proxy_pass http://secboard_backend;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /webrtc/ {
proxy_pass http://secboard_cast;
}
location /cunox/ {
client_max_body_size 50M;
proxy_pass http://secboard_backend;
}
location /img/ {
proxy_pass http://secboard_backend;
}
location /cs/ {
proxy_pass http://secboard_backend;
}
location /dialog/ {
proxy_pass http://secboard_backend;
}
location /health {
proxy_pass http://secboard_backend;
access_log off;
}
}