apiVersion: v1
kind: ConfigMap
metadata:
  name: object-detection-nginx-conf
data:
  nginx.conf: |-
    user  nginx;
    worker_processes  1;

    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;

    events {
        worker_connections  1024;
    }

    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;

        sendfile        on;
        keepalive_timeout  65;

        upstream application {
            server 127.0.0.1:3000;
        }

        server {
            listen 80;
            root /usr/src/app/;
            listen 443 ssl;
            ssl_certificate /etc/ssl/certs/server.crt;
            ssl_certificate_key /etc/ssl/certs/server.key;

            location / {
                proxy_pass http://application/;
            }
        }
    }
