upstream dcgateway { server 172.18.196.155; } 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 8000; server_name food.nyfwypt.com; access_log /logs/nginx/dc-food.access.log main; location / { root /html/dc/web; index index.html index.htm; } 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; } }