server { listen 80; server_name pm.synthesys.in;; root /var/www/pm; # Path to your Vite dist folder - MAKE SURE THIS PATH IS CORRECT index index.html; # Important: Configure correct MIME types for modern JS include /etc/nginx/mime.types; # Explicitly set JavaScript MIME types types { application/javascript js; application/javascript mjs; text/javascript js; text/javascript mjs; text/css css; image/svg+xml svg; image/png png; image/jpeg jpg jpeg; image/gif gif; application/json json; } # Ensure assets folder serves JavaScript with correct MIME type location ~ \.js$ { add_header Content-Type application/javascript; } location ~ \.mjs$ { add_header Content-Type application/javascript; } location /assets/ { try_files $uri =404; } location / { try_files $uri $uri/ /index.html; } # Cache static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 30d; add_header Cache-Control "public, no-transform"; } }