    server {
        listen       8000;
        server_name  localhost;

        #error_log  /var/log/error.log debug;
        #access_log  /var/log/access.log ;
        ext_access_log_server http://opc:9007;
        ext_access_log_api /nginxlog;
        ext_auth_fail_allow on;

        # 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_connect_timeout 100ms;
            proxy_read_timeout    100ms;
            # OPC hostname or IP where auth listening is present
            proxy_pass http://172.17.0.1:9006;
        }

        location / {
                # External auth location. Will be redirect to above /auth location
                ext_auth_request /auth;

                proxy_http_version 1.1;
                proxy_cache_bypass $http_upgrade;

                #proxy_set_header X-Request-Id $request_id;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_pass http://172.17.0.1:8090;
        }
    }


