Nginx: Reverse Proxy

Port Tunneling by Subdomain
server { server_name subdomain.domain.com; location / { proxy_pass http://targethost:5000/; } }

setiap request ke  akan ditangani oleh

Request Proxy
server { server_name multihost.domain.com; location /app1/ { proxy_pass https://otherdomain.com/path/; }

location /app2/ { proxy_pass http://otherhost:8080/; } }

Setiap request berupa  akan diteruskan ke

Sedangkan request misalnya  akan diteruskan ke

Read more

 * https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
 * https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-nginx
 * https://serverfault.com/questions/753105/how-to-reverse-proxy-to-different-places-depending-on-subdomain-in-nginx