Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

1.7 KB
Raw Blame
# ERB templated nginx configuration
# see https://doc.scalingo.com/platform/deployment/buildpacks/nginx

upstream backend_server {
	server localhost:8000 fail_timeout=0;
}

server {
  listen <%= ENV["PORT"] %>;
  server_name _;
  server_tokens off;

  root /app/build/frontend-out;

  # Django rest framework
  location ^~ /api/ {
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      proxy_redirect off;
      proxy_pass http://backend_server;
  }

  # Django admin
  location ^~ /admin/ {
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      proxy_redirect off;
      proxy_pass http://backend_server;
  }

  # Serve static files with caching
  location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
      expires 30d;
      add_header Cache-Control "public, max-age=2592000";
  }

  location = / {
      try_files /home.html /index.html;
      add_header Cache-Control "no-cache, no-store, must-revalidate";
      add_header Pragma "no-cache";
      add_header Expires 0;
  }

  location = /home.html {
      internal;
  }

  # Serve static files
  location / {
      try_files $uri $uri/ /index.html;
      # Add no-cache headers
      add_header Cache-Control "no-cache, no-store, must-revalidate";
      add_header Pragma "no-cache";  # HTTP 1.0 header for backward compatibility
      add_header Expires 0;
      add_header X-Robots-Tag "noindex, nofollow" always;
  }

  # Optionally, handle 404 errors by redirecting to index.html
  error_page 404 =200 /index.html;
}