Skip to content

Commit 0de57fd

Browse files
0x5cjonasfranz
authored andcommitted
Documentation: Clarity for HTTPS setups (#5626)
[https-setup] - Made it clearer that HTTP redirection is possible [config-cheat-sheet] - Clarified the behavihour of the redirection-related config keys
1 parent 9863591 commit 0de57fd

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
122122
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files.
123123
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
124124
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
125-
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests
126-
on another (https) port.
127-
- `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true.
125+
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, allows redirecting http requests on `PORT_TO_REDIRECT` to the https port Gitea listens on.
126+
- `PORT_TO_REDIRECT`: **80**: Port for the http redirection service to listen on. Used when `REDIRECT_OTHER_PORT` is true.
128127
- `ENABLE_LETSENCRYPT`: **false**: If enabled you must set `DOMAIN` to valid internet facing domain (ensure DNS is set and port 80 is accessible by letsencrypt validation server).
129128
By using Lets Encrypt **you must consent** to their [terms of service](https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf).
130129
- `LETSENCRYPT_ACCEPTTOS`: **false**: This is an explicit check that you accept the terms of service for Let's Encrypt.

docs/content/doc/usage/https-support.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,22 @@ HTTP_PORT = 3000
3030
CERT_FILE = cert.pem
3131
KEY_FILE = key.pem
3232
```
33+
3334
To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
3435

36+
### Setting-up HTTP redirection
37+
38+
The Gitea server is only able to listen to one port; to redirect HTTP requests to the HTTPS port, you will need to enable the HTTP redirection service:
39+
40+
```ini
41+
[server]
42+
REDIRECT_OTHER_PORT = true
43+
; Port the redirection service should listen on
44+
PORT_TO_REDIRECT = 3080
45+
```
46+
47+
If you are using Docker, make sure that this port is configured in your `docker-compose.yml` file.
48+
3549
## Using Let's Encrypt
3650

3751
[Let's Encrypt](https://letsencrypt.org/) is a Certificate Authority that allows you to automatically request and renew SSL/TLS certificates. In addition to starting Gitea on your configured port, to request HTTPS certificates Gitea will also need to listed on port 80, and will set up an autoredirect to HTTPS for you. Let's Encrypt will need to be able to access Gitea via the Internet to verify your ownership of the domain.

0 commit comments

Comments
 (0)