Skip to content

Commit fb1daad

Browse files
jonasfranzlunny
authored andcommitted
Add how-to for enabling HTTPS (#4101)
Signed-off-by: Jonas Franz <[email protected]>
1 parent da466b0 commit fb1daad

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
date: "2018-06-02T11:00:00+02:00"
3+
title: "Usage: HTTPS setup"
4+
slug: "https-setup"
5+
weight: 12
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "usage"
11+
name: "HTTPS setup"
12+
weight: 12
13+
identifier: "https-setup"
14+
---
15+
16+
# HTTPS setup to encrypt connections to Gitea
17+
18+
## Using built-in server
19+
20+
Before you enable HTTPS make sure that you have valid SSL/TLS certificates.
21+
You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate.
22+
23+
To use Gitea's built-in HTTPS support you must change your `app.ini` file:
24+
25+
```ini
26+
[server]
27+
PROTOCOL=https
28+
ROOT_URL = `https://git.example.com:3000/`
29+
HTTP_PORT = 3000
30+
CERT_FILE = cert.pem
31+
KEY_FILE = key.pem
32+
```
33+
To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
34+
35+
## Using reverse proxy
36+
37+
Setup up your reverse proxy like shown in the [reverse proxy guide](../reverse-proxies).
38+
39+
After that, enable HTTPS by following one of these guides:
40+
41+
* [nginx](https//nginx.org/en/docs/http/configuring_https_servers.html)
42+
* [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html)
43+
* [caddy](https://caddyserver.com/docs/tls)
44+
45+
Note: You connection between your reverse proxy and gitea might be unencrypted. To encrypt it too follow the [built-in server guide](#using-built-in-server) and change
46+
the proxy url to `https://[URL]`.

0 commit comments

Comments
 (0)