Great Blog

05 Feb 2021

DroneCI behind NGiNX reverse proxy

This so far has been working for me to have DroneCI behind an NGiNX reverse proxy working with Gitea

NGiNX Code

nano /etc/nginx/sites-available/

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled

upstream droneci {
server {

        listen 443 ssl http2;
        ssl_certificate            /etc/certs/;
        ssl_certificate_key        /etc/certs/;
        ssl_session_cache  builtin:1000  shared:SSL:10m;
        ssl_protocols TLSv1.2 TLSv1.3;

        location / {
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host;
                proxy_pass http://droneci;
                proxy_redirect off;
                proxy_http_version 1.1;
                proxy_buffering off;
                chunked_transfer_encoding off;

Here is the code for the docker container

docker run \
--volume=/var/lib/drone:/data \
--env=DRONE_SERVER_PROTO="https" \
--publish=8080:80 \
--restart=always \
--detach=true \
--name="" \