From 5c3be56f7bad9f068b8e8c0c3d6664b6847349c6 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 29 Mar 2020 22:11:15 +0100 Subject: [PATCH] Add IIS Reverse Proxy documentation (#10881) * Add IIS Reverse Proxy documentation @mahdiit in #10748 described how to set up IIS as a reverse proxy. This PR adds these to our documentation. Close #10748 Signed-off-by: Andrew Thornton * Update docs/content/doc/usage/reverse-proxies.en-us.md Co-Authored-By: mrsdizzie Co-authored-by: mrsdizzie --- .../doc/usage/reverse-proxies.en-us.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/docs/content/doc/usage/reverse-proxies.en-us.md b/docs/content/doc/usage/reverse-proxies.en-us.md index e9b0a3109a..704b02e40a 100644 --- a/docs/content/doc/usage/reverse-proxies.en-us.md +++ b/docs/content/doc/usage/reverse-proxies.en-us.md @@ -174,3 +174,59 @@ git.example.com { ``` Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. + +## Using IIS as a reverse proxy + +If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite as reverse proxy. + +1. Setup an empty website in IIS, named let's say, `Gitea Proxy`. +2. Follow the first two steps in [Microsoft's Technical Community Guide to Setup IIS with URL Rewrite](https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222#M343). That is: + - Install Application Request Routing (ARR for short) either by using the Microsoft Web Platform Installer 5.1 (WebPI) or downloading the extension from [IIS.net]( https://www.iis.net/downloads/microsoft/application-request-routing) + - Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console called URL Rewrite. + - Open the IIS Manager Console and click on the `Gitea Proxy` Website from the tree view on the left. Select and double click the URL Rewrite Icon from the middle pane to load the URL Rewrite interface. + - Choose the `Add Rule` action from the right pane of the management console and select the `Reverse Proxy Rule` from the `Inbound and Outbound Rules` category. + - In the Inbound Rules section, set the server name to be the host that Gitea is running on with its port. e.g. if you are running Gitea on the localhost with port 3000, the following should work: `127.0.0.1:3000` + - Enable SSL Offloading + - In the Outbound Rules, ensure `Rewrite the domain names of the links in HTTP response` is set and set the `From:` field as above and the `To:` to your external hostname, say: `git.example.com` + - Now edit the `web.config` for your website to match the following: (changing `127.0.0.1:3000` and `git.example.com` as appropriate) + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +```