# Translating NGINX to Traefik Rules

**URL:** <https://community.traefik.io/t/translating-nginx-to-traefik-rules/14817>\
**Category:** Traefik v2\
**Tags:** docker, middleware\
**Created:** [June 20, 2022, 10:21am UTC](https://community.traefik.io/t/translating-nginx-to-traefik-rules/14817 "2022-06-20T10:21:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LubricantJam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lubricantjam/32/5485_2.png) [@LubricantJam](https://community.traefik.io/u/LubricantJam)\
**Post date:** [June 20, 2022, 10:21am UTC](https://community.traefik.io/t/translating-nginx-to-traefik-rules/14817/1 "2022-06-20T10:21:10Z")

</div>

Hey,

I’m trying to make some amends to my Traefik installation to cater for these NGINX changes. Obviously I don’t use NGINX here so I’m trying to come up with a solution and this is what I’ve got so far.

```auto

http:
  ## ROUTERS ##
  routers:
    forgot:
      entryPoints:
        - https
      rule: 'Host(`<redacted>`) && Path(`/Users/ForgotPassword`)'
      service: forgot
      middlewares:
      - passwordReset
    forgotPin:
      entryPoints:
        - https
      rule: 'Host(`<redacted>`) && Path(`/Users/ForgotPassword/Pin`)'
      service: forgotPin
      middlewares:
      - passwordReset

  ## SERVICES ##
  services:
    forgot:
      loadBalancer:
        servers:
          - url: http://jellyfin:8096/Users/ForgotPassword
    forgotPin:
      loadBalancer:
        servers:
          - url: http://jellyfin:8096/Users/ForgotPassword/Pin

  ## MIDDLEWARES ##
  middlewares:
    # Jellyfin Header
    passwordReset:
      headers:
        customRequestHeaders:
          X-Forwarded-For: 127.0.0.1

```

This however doesn’t work and I’m not too sure why it’s not working as it looks to be what the docs translate to. Here is a link of what I am trying to achieve for my Jellyfin installation.

> **[Password Resets outside local network](https://wiki.jfa-go.com/docs/password-resets/)**
>
> Password resets outside local network # If you have Jellyfin set up to recognize connections from the LAN network, it will complain when a user tries to do a password reset remotely:
> If you’re using a reverse proxy, Jellyfin knows the real IP of a...

Appreciate any help!

---

<div class="post-metadata">

**Author:** ![moutoum](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/moutoum/32/5325_2.png) [@moutoum](https://community.traefik.io/u/moutoum)\
**Post date:** [June 20, 2022, 12:14pm UTC](https://community.traefik.io/t/translating-nginx-to-traefik-rules/14817/2 "2022-06-20T12:14:25Z")

</div>

Hi @LubricantJam,

I do not see any obvious error in what you are trying to achieve.  
Is the `X-Forwarded-For` header correctly added in the request?  
You can check this by added a simple netcat or something similar instead of your jellyfin app.

Thanks,  
Maxence

---

<div class="post-metadata">

**Author:** ![LubricantJam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lubricantjam/32/5485_2.png) [@LubricantJam](https://community.traefik.io/u/LubricantJam)\
**Post date:** [June 26, 2022, 8:31pm UTC](https://community.traefik.io/t/translating-nginx-to-traefik-rules/14817/3 "2022-06-26T20:31:59Z")

</div>

It seems like it's not adding the header. I'm not sure if this is to do with the rules or not, I even tried testing with other headers in-case I got that wrong but it still does not work.
