upstream dcgateway { server 172.18.196.155; } upstream auth { server 172.18.196.155:8100; } server { listen 80; server_name food.nyfwypt.com; access_log /logs/nginx/dc-food.access.log main; location / { root /html/dc/web; index index.html index.htm; } } server { listen 88; server_name dcgateway; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; proxy_pass http://dcgateway; } } server { listen 9000; server_name auth; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; proxy_pass http://auth; } } server { listen 8000; server_name web; root /html/dc/web; location / { root html; index index.html; } location ^~ /oauth/redirect { rewrite ^(.*)$ /index.html break; } location ^~ /api { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; rewrite ^/api/(.*)$ /$1 break; proxy_pass http://dcgateway; } }