nginx.conf

Home   »   nginx.conf

upstream old_server {
  server 192.168.1.2:5003;
  server 192.168.1.3:5002;
  server 127.0.0.1:5001;
  server 192.168.1.10:5000;
}
upstream new_server {
  server 127.0.0.1:5005;
}


server {
       location ~^/v2/ {
          proxy_set_header X-Real-IP $remote_addr ;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
          proxy_set_header Host $host;
          rewrite     ^/nodejs/(.*)     /$1  break;
          proxy_pass http://new_server;
        }
      location ~^/v1/ {
          proxy_set_header X-Real-IP $remote_addr ;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
          proxy_set_header Host $host;
          rewrite     ^/nodejs/(.*)     /$1  break;
          proxy_pass http://old_server;
        }

}

Leave a Reply

Your email address will not be published. Required fields are marked *