kind: ConfigMap
apiVersion: v1
metadata:
  name: rnapuzzles-sites-enabled-configmap
data:
  ucr-app.conf: |
    upstream django {
      server django-service:3001;
    }

    server {
      listen 80;
      client_max_body_size 4G;

      # set the correct host(s) for your site
      server_name 127.0.0.1;

      access_log /var/log/nginx/access.log combined;
      error_log  /var/log/nginx/error.log warn;

      keepalive_timeout 5;

      # path for static files (only needed for serving local staticfiles)
      

      location /static/ {
        # checks for static file, if not found proxy to app
        alias /var/www/html/;
      
      }

      location / {
        proxy_pass http://django;
        proxy_set_header Host            django-service;
        proxy_set_header X-Forwarded-For $remote_addr;
      }

      error_page 500 502 503 504 /500.html;
      location = /500.html {
        root /var/www/html/;
      }
    }
