worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; upstream namer{ server x.x.x.x:x; server x.x.x.x:x; server x.x.x.x:x; server x.x.x.x:x; } server { listen x; server_name x.x.x.x; location / { proxy_pass http://name; client_max_body_size 30m; } location ^~/path/ { proxy_pass http://x.x.x.x:x/; } location ^~/path/ { proxy_pass http://.x.x.x:x/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen x ssl; //https server_name x.x.x.x; ssl_certificate ../path1/path2; ssl_certificate_key ../path1/path2; location ^~/aiam/ { proxy_pass https://xx.com:x/; client_max_body_size 30m; } } }