1

I have a situation where I need to set up GitLab behind an IIS.

The GitLab instance is working perfectly fine within the LAN, but trying to set it up through IIS reverse proxy doesn't work.

I get 502 / Bad Gateway no matter what I try.

Any idea how to solve this?

BAndonovski
  • 111
  • 3

1 Answers1

0

It can be incorrectly specified docker ip address. Here is my working web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Let's encypt" stopProcessing="true">
                    <match url="^\.well-known.*$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="None" />
                </rule>
                <rule name="gitlab forwarding" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <serverVariables>
                        <set name="HTTP_X_FORWARDED_HOST" value="your.public.domain" />
                    </serverVariables>
                    <action type="Rewrite" url="http://192.168.99.100:10080/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
  • I'm using IIS 10 and facing issue: `The server variable "HTTP_X_FORWARDED_HOST" is not allowed to be set. Add the server variable name to the allowed server variable list.`, removed the `` section and it works! – chakming Aug 31 '17 at 03:04