worker_processes  1;
pid /dev/null;
daemon off;
error_log stderr debug;

events {
    worker_connections  1024;
}

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

  sendfile        on;
  keepalive_timeout  65;

  map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
  }

  server {
    access_log   /dev/stderr;
    listen       8000 ssl;
    server_name  localhost;
    ssl_certificate     nginx-selfsigned.crt;
    ssl_certificate_key nginx-selfsigned.key;
    ssl_protocols TLSv1.3;
    error_page 497  https://$http_host$request_uri;
    location /api {
      proxy_ssl_verify off;
      proxy_pass  https://localhost:8888;
    }
    location /assets {
      proxy_pass  http://localhost:5173;
      proxy_ssl_verify off;
    }
    location /app {
      proxy_pass  http://localhost:5173/;
      proxy_ssl_verify off;
    }
    location / {
      proxy_ssl_verify off;
      proxy_pass  http://localhost:5173/;
    }
  }
}
