proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location / { if ($host = app1.website.com) { proxy_pass http://app1:3000; } if ($host = app2.website.com) { proxy_pass http://app2; } }