You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

https-support.md 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # HTTPS setup to encrypt connections to Gitea
  16. ## Using built-in server
  17. Before you enable HTTPS make sure that you have valid SSL/TLS certificates.
  18. You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate.
  19. To use Gitea's built-in HTTPS support you must change your `app.ini` file:
  20. ```ini
  21. [server]
  22. PROTOCOL=https
  23. ROOT_URL = `https://git.example.com:3000/`
  24. HTTP_PORT = 3000
  25. CERT_FILE = cert.pem
  26. KEY_FILE = key.pem
  27. ```
  28. To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
  29. ## Using reverse proxy
  30. Setup up your reverse proxy like shown in the [reverse proxy guide](../reverse-proxies).
  31. After that, enable HTTPS by following one of these guides:
  32. * [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html)
  33. * [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html)
  34. * [caddy](https://caddyserver.com/docs/tls)
  35. 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
  36. the proxy url to `https://[URL]`.