Skip to content

Commit 44286e2

Browse files
reverse proxy for IIS (#15555)
Co-authored-by: techknowlogick <[email protected]>
1 parent 418c5fe commit 44286e2

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

docs/content/doc/usage/reverse-proxies.en-us.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,24 @@ If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite a
222222
<?xml version="1.0" encoding="UTF-8"?>
223223
<configuration>
224224
<system.webServer>
225+
<security>
226+
<requestFiltering>
227+
<hiddenSegments>
228+
<clear />
229+
</hiddenSegments>
230+
<denyUrlSequences>
231+
<clear />
232+
</denyUrlSequences>
233+
<fileExtensions allowUnlisted="true">
234+
<clear />
235+
</fileExtensions>
236+
</requestFiltering>
237+
</security>
225238
<rewrite>
226-
<rules>
239+
<rules useOriginalURLEncoding="false">
227240
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
228241
<match url="(.*)" />
229-
<action type="Rewrite" url="http://127.0.0.1:3000/{R:1}" />
242+
<action type="Rewrite" url="http://127.0.0.1:3000{UNENCODED_URL}" />
230243
<serverVariables>
231244
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="HTTP_ACCEPT_ENCODING" />
232245
<set name="HTTP_ACCEPT_ENCODING" value="" />
@@ -255,6 +268,16 @@ If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite a
255268
</outboundRules>
256269
</rewrite>
257270
<urlCompression doDynamicCompression="true" />
271+
<handlers>
272+
<clear />
273+
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
274+
</handlers>
275+
<!-- Map all extensions to the same MIME type, so all files can be
276+
downloaded. -->
277+
<staticContent>
278+
<clear />
279+
<mimeMap fileExtension="*" mimeType="application/octet-stream" />
280+
</staticContent>
258281
</system.webServer>
259282
</configuration>
260283
```

0 commit comments

Comments
 (0)