As I’m trying to setup the drone server, I migrated the local nginx installation to docker so I can proxy drone with it.
I did the configuration as in the documentation (http://docs.drone.io/setup-with-nginx/), but it just doesn’t let me.
Since I’m somewhat new setting up stuff I’m not too sure if it’s an issue with my nginx configuration or with my drone setup.
Anyways, I get the following error from the access-log from nginx:
2018/08/28 16:03:42 [error] 7#7: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: ci.prefix.moe, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "ci.prefix.moe"
2018/08/28 16:03:42 [error] 7#7: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: ci.prefix.moe, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "ci.prefix.moe", referrer: "http://ci.prefix.moe/"
The browser itself receives a 502 Bad Gateway from nginx then.
docker-compose.yaml
version: '2'
services:
drone-server:
image: drone/drone:0.8
ports:
- 8000
- 9000
volumes:
- /srv/drone:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=true
- DRONE_HOST=http://ci.prefix.moe
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/agent:0.8
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /srv/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server:9000
- DRONE_SECRET=${DRONE_SECRET}
My nginx-configuration for it:
server {
listen 80;
server_name ci.prefix.moe;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_buffering off;
chunked_transfer_encoding off;
}
}