Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Multiple proxies with name based virtual hosts? #55

Open
kcowgill opened this Issue · 1 comment

2 participants

@kcowgill

I'm attempting to get one nginx process to proxy for two separate webapps differentiated by hostname. Here's my nginx.conf:

worker_processes  1;


events {
    worker_connections  1024;
}

tcp {
  upstream app1 {
    server 127.0.0.1:8000;
  }
  upstream app2 {
    server 127.0.0.1:9000;
  }
  server {
    listen 80;
    server_name app1;
    proxy_pass app1;
    access_log /sitelogs/nginx/app1-access.log;
  }
  server {
    listen 80;
    server_name app2;
    proxy_pass app2;
    access_log /sitelogs/nginx/app2-access.log;
  }
}

but it doesn't seem to be working. Any requests to the box at either hostname are all getting proxied to app1.

Is what I'm trying possible, or do I need to find another solution? What am I missing?

Thanks!

@yaoweibin
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.