-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcorecast.conf
More file actions
103 lines (77 loc) · 3.22 KB
/
corecast.conf
File metadata and controls
103 lines (77 loc) · 3.22 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
# BLOCK 1: Handles insecure HTTP on port 80
server {
listen 80;
listen [::]:80;
server_name home-1-evanp.duckdns.org;
return 301 https://$server_name$request_uri;
}
# BLOCK 2: Handles SECURE HTTPS/WSS on port 443
server {
listen 443 ssl;
listen [::]:443 ssl;
# listen 5000 ssl;
# listen [::]:5000 ssl;
server_name home-1-evanp.duckdns.org;
# --- Your SSL Certificate ---
ssl_certificate /etc/letsencrypt/live/home-1-evanp.duckdns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/home-1-evanp.duckdns.org/privkey.pem;
# --- Standard SSL Settings ---
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'HIGH:!aNULL:!MD5';
# --- WebSocket location for /audio ---
location /audio {
proxy_pass http://127.0.0.1:5050/audio;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
add_header 'Access-Control-Allow-Origin' 'https://corecastsdr.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
}
# --- WebSocket location for /waterfall ---
location /waterfall {
proxy_pass http://127.0.0.1:5050/waterfall;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
add_header 'Access-Control-Allow-Origin' 'https://corecastsdr.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
proxy_buffering off;
proxy_cache off;
# Crucial for long-running websocket connections
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
}
# --- /metrics location ---
location /metrics {
proxy_pass http://127.0.0.1:8001/metrics;
add_header 'Access-Control-Allow-Origin' 'https://corecastsdr.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
}
}