INNER CODE UNIT · Python

debug_ip

philippemerle/KubeDiagrams · webapp/backend/app.py:31

    def debug_ip():
        """
        Debug endpoint to check IP detection.
        Returns all IP-related information for debugging proxy configuration.
        """
        return jsonify({
            'detected_ip': get_real_ip(),
            'remote_addr': request.remote_addr,
            'headers': get_all_ip_headers(),
            'behind_proxy': Config.BEHIND_PROXY,
            'proxy_x_for': Config.PROXY_X_FOR
        }), 200

    # Proxy Configuration
    # When running behind a reverse proxy (nginx, Apache, HAProxy), the proxy
    # forwards requests to the application. By default, Flask sees the proxy's IP
    # instead of the real client IP. ProxyFix corrects this by reading the
    # X-Forwarded-* headers that the proxy sets.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…