Task: Use CodeSonar with a Reverse Proxy

Some reverse proxy behaviors can interfere with communication between the CodeSonar analysis and the hub.

This task describes how to configure your reverse proxy to allow CodeSonar to work correctly, using NGINX as an example.

Note that it is not possible to use certificate-based hub authentication in the presence of a proxy or reverse proxy.



General Requirements

Reverse proxy behaviors such as buffering, caching, and timeouts can interfere with communication between the CodeSonar analysis and the hub.

Configuring your reverse proxy to allow CodeSonar to work correctly will generally include the following.

Note: It is not possible to use certificate-based hub authentication in the presence of a proxy or reverse proxy. TLS client authentication is designed to prevent "man in the middle" attacks and the reverse proxy is a man in the middle.

Example: NGINX

The following NGINX configuration will allow CodeSonar to work correctly.

http {

    server {
        ...
        ...

        location / {
            ...
            ...
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_buffering off;
            proxy_cache off;
            proxy_request_buffering off;
            proxy_read_timeout 1w;
            proxy_connect_timeout 300s;
        }
    }
}

For more information about these settings, see the following links.

Links