Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server localhost:8080 fail_timeout=0;
server {
#listen 80;
listen 443 ssl;
keepalive_timeout 70;
server_tokens off;
ssl_certificate ssl/;
ssl_certificate_key ssl/;
charset utf-8;
root /dev/null;
# Increase this if you want to upload larger attachments
client_max_body_size 20m;
location / {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://localhost:8080;

francoism90 commented Aug 25, 2015

Don't forget to update gitlab.yml:

production: &base
  #1. GitLab app settings
  # ==========================

  ## GitLab settings
    ## Web server settings (note: host is the FQDN, do not include http://)
    port: 443 # Set to 443 if using HTTPS, see for additional HTTPS configuration details
    https: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment