RequestBin in a docker-compose

less than 1 minute read

Clone the source code :

git clone https://github.com/Runscope/requestbin.git

Modify the port in the docker-compose.yml to 8037. Then build and start the docker :

sudo docker-compose build
sudo docker-compose up -d

The nginx configuration then looks like this :

server {

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name requestbin.sammy.fr www.requestbin.sammy.fr;
    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://127.0.0.1:8037;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/requestbin.sammy.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/requestbin.sammy.fr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}


server {
    
    if ($host = www.requestbin.sammy.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = requestbin.sammy.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80 default_server;
    listen [::]:80 default_server;

    server_name requestbin.sammy.fr www.requestbin.sammy.fr;
    return 404; # managed by Certbot
}