# Trust NPM-Proxy für Real-IP + Forwarded-Proto set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; upstream php-fpm { server app:9000; } upstream reverb { server reverb:8080; } upstream vite { server host.docker.internal:5173; } # === app.dev.clupilot.com === server { listen 80; server_name app.dev.clupilot.com; root /var/www/html/public; index index.php; client_max_body_size 100M; # Vite Dev-Assets über gleiche Domain location ^~ /build/ { proxy_pass http://vite; 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 https; } # Vite HMR WebSocket location /vite-hmr { proxy_pass http://vite; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_read_timeout 86400; } # Vite Module-Resolution location ~ ^/(@vite|@id|@fs|resources|node_modules)/ { proxy_pass http://vite; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass php-fpm; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; include fastcgi_params; } } # === api.dev.clupilot.com === server { listen 80; server_name api.dev.clupilot.com; root /var/www/html/public; index index.php; location / { try_files $uri /index.php?$query_string; } location ~ \.php$ { fastcgi_pass php-fpm; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; include fastcgi_params; } } # === ws.dev.clupilot.com → Reverb === server { listen 80; server_name ws.dev.clupilot.com; location / { proxy_pass http://reverb; 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 https; proxy_read_timeout 86400; } }