On Fri, Mar 6, 2020 at 12:07 PM YuanSheng Wang <[email protected]> wrote:
>
> I want to ask a question.
>
> How to configure this `location` by APISIX way?

You can take a look at this plugin example first:

https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md#how-to-enable

It should be like this:

curl http://127.0.0.1:9080/apisix/admin/routes/1  \
    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/beamer/*",
    "plugins": {
        "proxy-rewrite": {
            "regex_uri": [" ^/beamer/(.*)", "/$1"]
        }
    },
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "127.0.0.1:3080": 1
        }
    }
}'

>
>
> location /beamer/ {
>         rewrite ^/beamer/(.*)$ /$1 break;
>         proxy_pass http://127.0.0.1:3080/;
>     }
>
>
>  yours,
>  Ben
>
> On Fri, Mar 6, 2020 at 12:04 PM 奔波虫 <[email protected]> wrote:
> >
> > Dear all,
> >
> >
> > &nbsp; &nbsp; &nbsp; I want to ask a question.
> >
> >
> > &nbsp; &nbsp; &nbsp; &nbsp;How to&nbsp;configure the location:
> >
> > &nbsp; &nbsp; &nbsp;
> > location /beamer/ {
> > &nbsp; &nbsp; &nbsp; &nbsp; rewrite ^/beamer/(.*)$ /$1 break;
> > &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass http://127.0.0.1:3080/;&nbsp;&nbsp;
> > &nbsp; &nbsp; }
> >
> >
> >
> >
> >
> > &nbsp;yours,
> > &nbsp;Ben
>
>
>
> --
> MembPhis
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix



-- 
MembPhis
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix

Reply via email to