server { listen 0.0.0.0:3000; listen [::]:3000; server_name dev3.4nkweb.com; # HTTP pur: pas de HTTPS ni HSTS # Favicon location = /favicon.ico { root /home/debian/lecoffre_node/conf/nginx/assets; } # Compat: callback ID.not sans basePath (toutes variantes et querystring) location /authorized-client { proxy_pass http://127.0.0.2:3004/lecoffre/authorized-client; include /etc/nginx/proxy_params; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Prefix /lecoffre; proxy_read_timeout 300; } # Entrée sans slash location = /lecoffre { proxy_pass http://127.0.0.2:3004; include /etc/nginx/proxy_params; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Prefix /lecoffre; proxy_read_timeout 300; } # BasePath /lecoffre location /lecoffre/ { proxy_pass http://127.0.0.2:3004; include /etc/nginx/proxy_params; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Prefix /lecoffre; proxy_read_timeout 300; } # HMR (si utilisé en local) location /lecoffre/_next/webpack-hmr { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto http; proxy_buffering off; proxy_pass http://127.0.0.2:3004/lecoffre/_next/webpack-hmr; proxy_read_timeout 600s; } # Assets Next.js location ~* ^(/_next/static/|/lecoffre/_next/static/|/.+\.(?:css|js|png|jpg|jpeg|gif|svg|ico|webp|woff2?))$ { expires 7d; add_header Cache-Control "public, max-age=604800, immutable" always; proxy_pass http://127.0.0.2:3004$request_uri; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto http; proxy_read_timeout 300; } }