NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.08k stars 2.68k forks source link

Seems to break Next-Auth however this works - can I do it in your software #2377

Open redimongo opened 2 years ago

redimongo commented 2 years ago

I am wondering how can I do the following using your software

server {
  listen 80 default_server;

  server_name DOMAIN.com.au;

  server_tokens off;

  client_body_buffer_size 300m;
  client_max_body_size    300m;

  gzip on;
  gzip_proxied any;
  gzip_comp_level 4;
  gzip_types text/css application/javascript image/svg+xml;

  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection 'upgrade';
  proxy_set_header Host $host;
  proxy_cache_bypass $http_upgrade;

  # BUILT ASSETS (E.G. JS BUNDLES)
  # Browser cache - max cache headers from Next.js as build id in url
  # Server cache - valid forever (cleared after cache "inactive" period)
  location /_next {
    proxy_cache STATIC;
    proxy_pass http://nextjs;
  }

  location /.well-known/acme-challenge/ {
        root /var/www/certbot;
  }

  location /.well-known/ {
        return 301 https://$host$request_uri;
  }
  # STATIC ASSETS (E.G. IMAGES)
  # Browser cache - "no-cache" headers from Next.js as no build id in url
  # Server cache - refresh regularly in case of changes
  location /static {
    proxy_cache STATIC;
    proxy_ignore_headers Cache-Control;
    proxy_cache_valid 60m;
    proxy_pass http://nextjs;
  }

  # DYNAMIC ASSETS - NO CACHE
  location / {
    proxy_pass http://nextjs;
  }
}
github-actions[bot] commented 9 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: