Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddy recipe does not work using docker-compose.yml configuration #311

Open
tomsiwik opened this issue Feb 27, 2018 · 3 comments
Open

Caddy recipe does not work using docker-compose.yml configuration #311

tomsiwik opened this issue Feb 27, 2018 · 3 comments

Comments

@tomsiwik
Copy link

tomsiwik commented Feb 27, 2018

I'm unsuccessfully trying to make caddy work with gitlab using given recipe. However, i'm currently stuck at 502 and searching and finding the same configurations of caddy and gitlab through a reverse proxy setup everywhere. Can somebody help me out and tell me if my current configuration is valid or what i'm actually doing wrong?

Caddyfile:

https://git.example.com {

    tls [email protected]

    log git.access.log {
        rotate_size     50
        rotate_age      90
        rotate_keep     20
        rotate_compress
    }

    errors git.errors.log {
        404 /var/gitlab/404.html
        422 /var/gitlab/422.html
        500 /var/gitlab/500.html
        502 /var/gitlab/502.html
    }

    proxy / gitlab:8181 {
        fail_timeout 0s
        header_upstream X-Forwarded-Ssl on
        transparent
    }
}

https://*.pages.example.com {
    tls { max_certs 15 }

    proxy / gitlab:8090 {
        fail_timeout 0s
        transparent
    }
}

docker-compose.yml:

version: '3.3'

volumes:
    gitlab:

services:
    gitlab:
        container_name: gitlab
        image: gitlab/gitlab-ee:latest
        restart: always
        expose:
            - "8181"
            - "8090"
        environment:
            GITLAB_OMNIBUS_CONFIG: |
                external_url 'https://git.example.com'
                gitlab_workhorse['listen_network'] = "tcp"
                gitlab_workhorse['listen_addr'] = "localhost:8181"
                nginx['enable'] = "false"
                nginx['custom_gitlab_server_config'] = "proxy_buffering off;"

                pages_external_url 'https://pages.example.com'
                gitlab_pages['enable'] = true
                gitlab_pages['listen_proxy'] = "localhost:8090"
                gitlab_pages['redirect_http'] = true
                gitlab_pages['use_http2'] = true
        volumes:
            - "gitlab:/opt/gitlab/embedded/service/gitlab-rails/public"
            - "./gitlab:/etc/gitlab"
            - "./log/gitlab:/var/log/gitlab"
            - "./opt/gitlab:/var/opt/gitlab"

    caddy:
        build:
            context: github.com/abiosoft/caddy-docker.git
            args:
                plugins: reauth
        image: abiosoft/caddy
        container_name: caddy
        ports:
            - "80:80"
            - "443:443"
        links:
            - gitlab
        volumes:
            - "gitlab:/var/gitlab"
            - "./Caddyfile:/etc/Caddyfile"
            - "./www:/var/www"
        restart: always

Troubleshooting so far:

curl -L gitlab:8181 inside caddy container returns connection refused.
curl -L localhost:8181 inside caddy container returns valid html.

Any suggestions i might try?

@Freekers
Copy link

Almost 3 years later and I'm experiencing exactly the same issue. Did you ever manage to figure this one out?

Thanks

@tomsiwik
Copy link
Author

tomsiwik commented Jan 3, 2021

Yes, using the official caddy docker v2, a custom dockerfile building my needed plugins and something similar to the following config: https://caddy.community/t/caddy-reverse-proxying-gitlab/5178/5 - tl;dr: I had to re-enable nginx and proxy back to it

@Freekers
Copy link

Freekers commented Jan 3, 2021

Yes, using the official caddy docker v2, a custom dockerfile building my needed plugins and something similar to the following config: https://caddy.community/t/caddy-reverse-proxying-gitlab/5178/5 - tl;dr: I had to re-enable nginx and proxy back to it

Thanks, that did the trick!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants