search

Home  >  Q&A  >  body text

nginx conf global parameter configuration

First of all, I don't quite understand how to describe the problem. So I wrote this title.
The actual situation is that I allocated two addresses in the js of the project:

serviceLoginUrl:"/arg/project/Login";
serviceUrl:"/arg/project/Webservice";

I think when nginx is running, nginx can directly parse /arg/project and replace it with
http://172.16.1.101:9080/myPro/Login and http://172.16.1.101:9080 A real address like /myPro/WebserviceX5X is a regular expression. I saw someone else implement it in apache like this. But I am using nginx and I don’t want to change apache. Please give me some answers from those who are familiar with nginx.

怪我咯怪我咯2755 days ago482

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-16 17:28:45

    location /arg/project/Login {
    rewrite ^/arg/project/Login$ /myPro/Login last;
    proxy_pass http://service_server;
    }

    upstream service_server {
    http://172.16.1.101:9080;
    }

    reply
    0
  • Cancelreply