🐳HTTPS Configuration For Docker Installations

1- Copy the SSL Key and SSL Crt pair to the "nginx" folder under the OOBEYA-DIRECTORY directory by changing their names to ssl.key and ssl.crt.

$ mv example.key /OOBEYA-DIRECTORY/nginx/ssl.key
$ mv example.crt /OOBEYA-DIRECTORY/nginx/ssl.crt

2- In the 'server_name' section, write your domain for both port 80 and port 443.

  • /OOBEYA-DIRECTORY/nginx/nginx.conf

  server {
    listen       80;
    listen       [::]:80;
    server_name  ops.oobeya.io;                         # YOUR DOMAIN
    access_log /var/log/nginx/access.log compression;
  server { # This new server will watch for traffic on 443
        listen              443 ssl;
        server_name         ops.oobeya.io;              # YOUR DOMAIN
        ssl_certificate     /etc/nginx/ssl.crt;
        ssl_certificate_key /etc/nginx/ssl.key;

3- Remove the comment lines under the Nginx service in docker-compose.yml.

  • /OOBEYA-DIRECTORY/docker-compose.yml

  oobeya-nginx:
    image: "oobeya.azurecr.io/oobeya-nginx-gateway:latest"
    restart: "always"
    ports:
      - "80:80"
#      - "443:443"
    container_name: "oobeya-nginx"
#    volumes:
#      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
#      - ./nginx/ssl.crt:/etc/nginx/ssl.crt
#      - ./nginx/ssl.key:/etc/nginx/ssl.key

4- Add "https://your-domain" to the CORS_ALLOWED_ORIGIN variable to be accessed with HTTPS.

$ vi /OOBEYA-DIRECTORY/env.list

CORS_ALLOWED_ORIGIN=https://your-domain

5- Finally, you can restart the Oobeya app using docker-compose.

$ docker-compose down && docker-compose up -d

Last updated