-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
95 lines (71 loc) · 2.78 KB
/
nginx.conf
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
upstream facade_app {
server 127.0.0.1:8080;
}
upstream grafana {
server 127.0.0.1:3000;
}
server {
server_name cassette-world.ru www.cassette-world.ru;
client_max_body_size 10M;
location /static/ {
proxy_pass https://cassette.hb.ru-msk.vkcloud-storage.ru/static/;
proxy_set_header Host cassette.hb.ru-msk.vkcloud-storage.ru;
proxy_redirect off;
add_header Cache-Control "public, max-age=31536000";
autoindex on;
}
location /images/ {
alias /home/ubuntu/images/;
add_header Cache-Control "public, max-age=31536000";
autoindex on;
}
location /assets/ {
alias /home/ubuntu/frontend/2024_2_GOATS/public/assets/;
add_header Cache-Control "public, max-age=31536000";
autoindex on;
}
location = /api/room/join {
proxy_pass http://facade_app; # Ваш WebSocket-сервер
proxy_http_version 1.1; # WebSocket требует HTTP/1.1
proxy_set_header Upgrade $http_upgrade; # WebSocket-заголовки
proxy_set_header Connection "Upgrade"; # WebSocket-заголовки
proxy_set_header Host $host; # Проброс оригинального Host
proxy_cache_bypass $http_upgrade; # Отключение кеша для WebSocket
}
location ~ ^/api/ {
proxy_pass http://facade_app;
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;
}
location /grafana {
proxy_pass http://grafana;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
root /home/ubuntu/frontend/2024_2_GOATS/dist;
index index.html;
try_files $uri $uri/ /index.html;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/cassette-world.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/cassette-world.ru/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.cassette-world.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = cassette-world.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name cassette-world.ru www.cassette-world.ru;
return 404; # managed by Certbot
}