-
-
Save devzerker/c9a51b2c4d24de8a726dfe41f9ca4a1b to your computer and use it in GitHub Desktop.
gitlab-ce omnibus docker behind a local nginx reverse proxy (letsencrypt ssl termination at local nginx)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| gitlab: | |
| image: gitlab/gitlab-ce:latest | |
| hostname: gitlab.example.com | |
| environment: | |
| GITLAB_OMNIBUS_CONFIG: | | |
| external_url 'https://gitlab.example.com/' | |
| nginx['listen_port'] = 80 | |
| nginx['listen_https'] = false | |
| letsencrypt['enable'] = false | |
| gitlab_rails['gitlab_shell_ssh_port'] = 31022 | |
| registry_external_url 'https://registry.example.com/' | |
| registry_nginx['listen_https'] = false | |
| registry_nginx['proxy_set_headers'] = { | |
| "X-Forwarded-Proto" => "https", | |
| "X-Forwarded-Ssl" => "on" | |
| } | |
| ports: | |
| - '31080:80' | |
| - '31088:8080' | |
| - '31022:22' | |
| volumes: | |
| - './config:/etc/gitlab' | |
| - './data:/var/opt/gitlab' | |
| - './logs:/var/log/gitlab' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl; | |
| server_name gitlab.example.com; | |
| ssl on; | |
| ssl_certificate /letsencrypt/fullchain.pem; | |
| ssl_certificate_key /letsencrypt/live/privkey.pem; | |
| location / { | |
| proxy_read_timeout 300; | |
| proxy_connect_timeout 300; | |
| proxy_redirect off; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto https; | |
| proxy_set_header X-Frame-Options SAMEORIGIN; | |
| proxy_pass http://127.0.0.1:31080; | |
| } | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name registry.example.com; | |
| ssl on; | |
| ssl_certificate /letsencrypt/fullchain.pem; | |
| ssl_certificate_key /letsencrypt/privkey.pem; | |
| location / { | |
| proxy_read_timeout 300; | |
| proxy_connect_timeout 300; | |
| proxy_redirect off; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto https; | |
| proxy_set_header X-Frame-Options SAMEORIGIN; | |
| proxy_pass http://127.0.0.1:31080; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment