🔧 Update Challonge API proxy configuration to simplify URL rewriting and enforce nginx proxy usage

This commit is contained in:
2026-01-29 14:27:08 +00:00
parent 819d7e0420
commit fa26c50ebc
2 changed files with 3 additions and 5 deletions

View File

@@ -68,7 +68,7 @@ server {
# Proxy Challonge API requests to avoid CORS # Proxy Challonge API requests to avoid CORS
location /api/challonge/ { location /api/challonge/ {
# Remove /api/challonge prefix and forward to Challonge API # Remove /api/challonge prefix and forward to Challonge API
rewrite ^/api/challonge/(.*) /v1/$1 break; rewrite ^/api/challonge/(.*) /$1 break;
proxy_pass https://api.challonge.com; proxy_pass https://api.challonge.com;
proxy_ssl_server_name on; proxy_ssl_server_name on;

View File

@@ -15,13 +15,11 @@
/** /**
* Get the appropriate base URL based on environment * Get the appropriate base URL based on environment
* Always use nginx proxy to avoid CORS issues
*/ */
function getBaseURL() { function getBaseURL() {
if (import.meta.env.DEV) {
return '/api/challonge/v2.1'; return '/api/challonge/v2.1';
} }
return 'https://api.challonge.com/v2.1';
}
/** /**
* Authentication types for Challonge API v2.1 * Authentication types for Challonge API v2.1