Nginx reverse proxy multi upstream (multiples sites)

cloud devops nginx-forum at
Fri Apr 10 16:45:21 UTC 2015


Here is my situation: I will have one frontend server running nginx, and
multiple backends servers running apache or tomcat with different 
applications. I am NOT trying to do any load balancing. What I need to do is
setup nginx to proxy connections to specific servers based on a specific IP
of nginx.

I'm using the nginx 1.6.1.

I tried the configuration below but I have trouble with the location
configuration, I need a dynamic configuration that does not impact the
backend servers.

cat nginx.conf : 
worker_processes  1;
worker_rlimit_nofile 100000;
error_log  logs/error.log warn;
pid        /home/nginx/logs/;

events {
  worker_connections  10240;
  use epoll;
  multi_accept  on;

  client_max_body_size 2048m;
  include       /home/nginx/naxsi/naxsi_config/naxsi_core.rules;
  #include       /etc/nginx/naxsi.rules;
  include       /home/nginx/conf/mime.types;
  default_type  application/octet-stream;
  server_tokens off;
  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';
  access_log  logs/access.log  main;

  include /home/nginx/conf/conf.d/*.conf;
  #include /etc/nginx/sites-enabled/*.conf;

cat conf.d/combined.conf : 

 upstream {
        server backup;


    upstream {
        server backup;


    server {
      location / {
      location /panel {

Posted at Nginx Forum:,257950,257950#msg-257950

More information about the nginx mailing list