Пример прокси-сервера HTTP

http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 10000m;
     
    error_log   logs/error.log debug;
 
    sendfile        on;   
    keepalive_timeout  65;
 
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }
 
    upstream httpServer {
        server localhost:9090;
    }
  
    upstream debugServer {
        server localhost:9091;
    }
     
    # HTTP Proxy Server
    server {
        listen       80;
        server_name  server.example.com;
 
        # HTTP       
        location / {          
            proxy_pass http://httpServer/;       
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Host $server_name;
            proxy_set_header X-Forwarded-Port $server_port;
            proxy_set_header X-Forwarded-Proto $scheme;          
            proxy_http_version 1.1;
        }
 
        # Debug (Web Sockets)   
        location /debug {
            proxy_pass http://debugServer/;           
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;           
            proxy_http_version 1.1;            
        }      
    }