server {
                ext_auth_fail_allow on;
                ext_access_log_server http://opc_server:9007;
                ext_access_log_total_size 36k;
                ext_access_log_body_size 32k;
                ext_access_log_api /nginxlog;
                ext_auth_request /auth;

                # External auth module location configuration
                # Please keep proxy headers as they are
                location /auth {
                        internal;
                        proxy_set_header X-Req-Uri $request_uri;
                        proxy_set_header X-Method $request_method;
                        proxy_set_header X-Req-Host $host;
                        proxy_set_header X-Client-Addr $remote_addr:$remote_port;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;

                        proxy_http_version 1.1;
                        proxy_set_header Connection "";
                        proxy_connect_timeout 500ms;
                        proxy_read_timeout    500ms;

                        # OPC hostname or IP where auth listening is present
                        proxy_pass http://opc_server:9006;
                }

                location / {
                        proxy_pass ........; # Your backend application call
                }
}
