Skip to content

Commit

Permalink
readme: add section on Configuring HSTS
Browse files Browse the repository at this point in the history
Refer #138
  • Loading branch information
jk authored and Sameer Naik committed Sep 19, 2014
1 parent 290d45e commit ed4a3e7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- [Strengthening the server security](#strengthening-the-server-security)
- [Installation of the Certificates](#installation-of-the-certificates)
- [Enabling HTTPS support](#enabling-https-support)
- [Configuring HSTS](#configuring-hsts)
- [Using HTTPS with a load balancer](#using-https-with-a-load-balancer)
- [Establishing trust with your server](#establishing-trust-with-your-server)
- [Installing Trusted SSL Server Certificates](#installing-trusted-ssl-server-certificates)
Expand Down Expand Up @@ -587,6 +588,22 @@ docker run --name=gitlab -d \

In this configuration, any requests made over the plain http protocol will automatically be redirected to use the https protocol. However, this is not optimal when using a load balancer.

#### Configuring HSTS

HSTS if supported by the browsers makes sure that your users will only reach your sever via HTTPS. When the user comes for the first time it sees a header from the server which states for how long from now this site should only be reachable via HTTPS - that's the HSTS max-age value.

With `GITLAB_HTTPS_HSTS_MAXAGE` you can configure that value. The default value is `31536000` seconds. If you want to disable a already sent HSTS MAXAGE value, set it to `0`.

```bash
docker run --name=gitlab -it --rm \
-e 'GITLAB_HTTPS=true' \
-e 'GITLAB_HTTPS_HSTS_MAXAGE=2592000'
-v /opt/gitlab/data:/home/git/data \
sameersbn/gitlab:latest
```

If you want to completely disable HSTS set `GITLAB_HTTPS_HSTS_ENABLED` to `false`.

#### Using HTTPS with a load balancer

Load balancers like nginx/haproxy/hipache talk to backend applications over plain http and as such the installation of ssl keys and certificates are not required and should **NOT** be installed in the container. The SSL configuration has to instead be done at the load balancer.
Expand Down

0 comments on commit ed4a3e7

Please sign in to comment.