nginx根据URL分配请求给不同的服务

在nginx的nginx.conf配置文件中追加下面代码,nginx.conf一般在/usr/local/nginx/conf下面

   server {

listen 80;
server_name 202.103.95.166;


location /web {           
     proxy_pass  http://192.168.23.32:8899/web;   
}


location /mobile {           
     proxy_pass  http://192.168.23.32:8899/mobile;
}

location /api {           
     proxy_pass  http://192.168.23.32:10009/api;
}

    }

猜你喜欢

转载自blog.csdn.net/h2520ny/article/details/80946774