This commit is contained in:
parent
c20a5e7486
commit
fc0385c8d5
3 changed files with 94 additions and 70 deletions
|
|
@ -377,8 +377,58 @@ http {
|
|||
add_header Cache-Control "no-store, no-cache" always;
|
||||
}
|
||||
|
||||
# Public realm endpoints (with viewer token authentication for stream-key)
|
||||
location ~ ^/api/realms/(by-name/[^/]+|live|[0-9]+/stats|[0-9]+/stream-key)$ {
|
||||
# Public site settings endpoint
|
||||
location = /api/settings/site {
|
||||
# CORS headers
|
||||
add_header Access-Control-Allow-Origin $cors_origin always;
|
||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
||||
add_header Access-Control-Allow-Headers "Content-Type" always;
|
||||
add_header Access-Control-Allow-Credentials "true" always;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header Content-Length 0;
|
||||
add_header Content-Type text/plain;
|
||||
return 204;
|
||||
}
|
||||
|
||||
proxy_pass http://backend;
|
||||
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;
|
||||
|
||||
# Cache site settings
|
||||
expires 30s;
|
||||
add_header Cache-Control "public, max-age=30" always;
|
||||
}
|
||||
|
||||
# Public honk sound endpoint
|
||||
location = /api/honk/active {
|
||||
# CORS headers
|
||||
add_header Access-Control-Allow-Origin $cors_origin always;
|
||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
||||
add_header Access-Control-Allow-Headers "Content-Type" always;
|
||||
add_header Access-Control-Allow-Credentials "true" always;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header Content-Length 0;
|
||||
add_header Content-Type text/plain;
|
||||
return 204;
|
||||
}
|
||||
|
||||
proxy_pass http://backend;
|
||||
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;
|
||||
|
||||
# Short cache
|
||||
expires 10s;
|
||||
add_header Cache-Control "public, max-age=10" always;
|
||||
}
|
||||
|
||||
# Public realm endpoints - includes single realm by ID (with viewer token authentication for stream-key)
|
||||
location ~ ^/api/realms/(by-name/[^/]+|live|[0-9]+|[0-9]+/stats|[0-9]+/stream-key)$ {
|
||||
# CORS headers
|
||||
add_header Access-Control-Allow-Origin $cors_origin always;
|
||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
||||
|
|
@ -471,6 +521,7 @@ http {
|
|||
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_set_header Cookie $http_cookie;
|
||||
|
||||
# WebSocket timeouts
|
||||
proxy_read_timeout 3600s;
|
||||
|
|
@ -493,6 +544,7 @@ http {
|
|||
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_set_header Cookie $http_cookie;
|
||||
|
||||
# WebSocket timeouts
|
||||
proxy_read_timeout 3600s;
|
||||
|
|
@ -516,6 +568,7 @@ http {
|
|||
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_set_header Cookie $http_cookie;
|
||||
|
||||
# WebSocket timeouts
|
||||
proxy_read_timeout 3600s;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue