# How to turn nginx settings into traefik

**URL:** <https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [April 13, 2023, 2:52am UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233 "2023-04-13T02:52:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scchengo](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@scchengo](https://community.traefik.io/u/scchengo)\
**Post date:** [April 13, 2023, 2:52am UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233/1 "2023-04-13T02:52:53Z")

</div>

Hi everyone! i am a newcomer of traefik. I used to use nginx as a reverse proxy solution.  
Recently i want to migrate to traefik. Here's is my question.  
This is my Nginx settings

```auto
location /central-test-fz1/ {
    proxy_pass https://api.tst1.ftest.com/;
}

```

i hope all the path behind **/central-test-fz1/** can be pass to [https://api.tst1.ftest.com/](https://api.tst1.ftest.com/) except **central-test-fz1**  
How can i turn this settings into traefik middleware?? or even routers?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [April 13, 2023, 7:42am UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233/2 "2023-04-13T07:42:49Z")

</div>

If you want to target different sites, you need multiple routers/services.

You could use a router with `rule=Host(`example.com`) && Path(`/central-test-fz1/`)` for the fixed path and `rule=Host(`example.com`) && PathPrefix(`/central-test-fz1/`)` for deeper paths.

Just set a higher `priority` (larger number, like 1000) for the first router, so it gets matched before the second.

---

<div class="post-metadata">

**Author:** ![scchengo](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@scchengo](https://community.traefik.io/u/scchengo)\
**Post date:** [April 13, 2023, 8:31am UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233/3 "2023-04-13T08:31:58Z")

</div>

i mean if i access localhost/central-test-fz1/api/v1/docs , i hope service behind the traefik access [https://api.tst1.ftest.com/api/v1/docs](https://api.tst1.ftest.com/api/v1/docs)

---

<div class="post-metadata">

**Author:** ![scchengo](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@scchengo](https://community.traefik.io/u/scchengo)\
**Post date:** [April 13, 2023, 8:36am UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233/4 "2023-04-13T08:36:13Z")

</div>

> [@bluepuma77](#):
>
> Host(`example.com`) && Path(`/central-test-fz1/`)

it seems not working!!! can u give me detail about it!!!!

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [April 13, 2023, 2:03pm UTC](https://community.traefik.io/t/how-to-turn-nginx-settings-into-traefik/18233/5 "2023-04-13T14:03:00Z")

</div>

Can you give examples of source and target URL, maybe two each?
