0

I'm using IIS as a reverse proxy and I've found that by default, when using the built in method to have IIS add the client IP into the X-Forwarded-For header, if the client IP is IPv6 it will encase the IP in [ ] (eg, [2406:cafe:1:beef:35e1:dead:1574:face]). For most applications I have IIS being a reverse proxy for, this is fine and doesn't cause issue but Home Assistant does not like the header having [ ] as part of the IP and so fails. I was hoping there might be a way to manipulate the content of that header in IIS to remove the [ ] encasing the IP.

I thought an Outbound rule might be the way to go and tried the following:

<rule name="IPv6 Remove []" enabled="true">
   <match serverVariable="HTTP_X_FORWARDED_FOR" pattern="\[(.*?)\]" />
   <action type="Rewrite" value="{R:1}" />
</rule>

But this hasn't had any effect. Is this actually possible to do with IIS?

1
  • Outbound rules manipulate the responses before sending them to the browsers, so it can never be the place for what you asked for.
    – Lex Li
    Commented Feb 18 at 6:52

0

You must log in to answer this question.

Browse other questions tagged .