• Stefy Lanza (nextime / spora )'s avatar
    Add nginx proxy support with X-Forwarded-Prefix header handling · 80af321d
    Stefy Lanza (nextime / spora ) authored
    - Updated ProxyFix configuration to handle all proxy headers (x_for, x_proto, x_host, x_port, x_prefix)
    - Added template context processor to inject script_root and url_root into all templates
    - Created JavaScript helper functions in base template for proxy-aware URL generation:
      - buildUrl() - Build URLs with correct proxy prefix
      - proxyFetch() - Make fetch requests with proxy-aware URLs
      - navigateTo() - Navigate to URLs with proxy prefix
      - getCurrentUrl() - Get current URL with proxy prefix
      - buildUrlWithParams() - Build URLs with query parameters
    - Updated all templates with hardcoded JavaScript URLs to use proxyFetch():
      - admin_settings.html
      - admin_users.html
      - admin_migrations.html
      - match_detail.html
      - fixture_detail.html
      - upload/zip.html
      - user_tokens.html
    - Updated templates with window.location.href to use navigateTo():
      - clients.html
      - reports.html
      - client_report_detail.html
    - Updated templates using window.location.href for URL manipulation to use getCurrentUrl():
      - match_report_detail.html
      - bet_detail.html
      - reports.html
      - client_report_detail.html
    - Created PROXY_SUPPORT.md documentation file
    
    This implementation ensures all URLs generated and managed in the web dashboard correctly handle the root path when behind an nginx proxy with X-Forwarded-Prefix header (e.g., /mbetterc).
    80af321d
base.html 14.3 KB