I’m deploying a Next.js 15.3.2 app with Tailwind CSS 4.1.6 on a VPS (godaddy VPS server)
Unanswered
Nawaz posted this in #help-forum
NawazOP
I’m deploying a Next.js 15.3.2 app with Tailwind CSS 4.1.6 on a VPS server using Nginx reverse proxy with Let’s Encrypt SSL.
The app works perfectly in local dev and ngrok, but in production:
• The layout is completely broken (Tailwind styles are missing)
• CSS files from _next/static/css/*.css throw a 502 Bad Gateway error
Here’s my postcss.config.js
// postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Please could you help me.
The app works perfectly in local dev and ngrok, but in production:
• The layout is completely broken (Tailwind styles are missing)
• CSS files from _next/static/css/*.css throw a 502 Bad Gateway error
Here’s my postcss.config.js
// postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Please could you help me.
12 Replies
NawazOP
ok, sure, let me try
anyone can you pls help asap
NawazOP
ok, sure
American black bear
What does your Dockerfile look like?
and nginx config
NawazOP
Hello @American black bear ,
Thank you for your response. I am directly deploying on the VPS server and today tried with docker.
I will share the files - deployment is successful but there are runtime isssues (all the content and images are brokent).
Kindly let me know if you need further information
Thank you for your response. I am directly deploying on the VPS server and today tried with docker.
I will share the files - deployment is successful but there are runtime isssues (all the content and images are brokent).
Kindly let me know if you need further information
I’m running a Next.js 15.3.2 app on a GoDaddy VPS (Linux). My app is JSON-driven and loads gallery data dynamically from files like public/config/womens-gallery-options.json.
Working Fine On Local (MacBook)
Broken On VPS – Some pages like /mens work, but /womens shows No images found in the gallery.
In browser DevTools, I see:
GET /api/gallery/womens 500 (Internal Server Error)
My file exists at:
/home/srktrends/public/config/womens-gallery-options.json
Docker build & run are working fine. Image paths are correct, permissions are fixed, file casing is right.
What could be causing the 500 error only for some JSON files during deployment, even though everything is identical to my local setup?
Working Fine On Local (MacBook)
Broken On VPS – Some pages like /mens work, but /womens shows No images found in the gallery.
In browser DevTools, I see:
GET /api/gallery/womens 500 (Internal Server Error)
My file exists at:
/home/srktrends/public/config/womens-gallery-options.json
Docker build & run are working fine. Image paths are correct, permissions are fixed, file casing is right.
What could be causing the 500 error only for some JSON files during deployment, even though everything is identical to my local setup?
American black bear
The logs could be helpful. Stop the container then run it again but this time with
docker compose up
leaving -d out will allow you to see the logs in the ssh console.then go to your app and and try loading images that dont work, this should cause errors in the ssh console.
try going to the image files directly, for example example.com/config/mens.json and see if it works that way.
also explain why are you using .json here and not storing an array of images in the code directly
also explain why are you using .json here and not storing an array of images in the code directly
NawazOP
Thank you, I've, I wanted to me it easy for easy changes in the JSON file.
Yesterday, I tried, but it didn't work. So I've tried and deployed onto Vercel and it worked in one go!.
Now, when I am making any changes to the code and pushing to the github - this is getting updated but vercel it taking the latest code - I tried redployment so many times and it says deployment is successful but with the same old content/code.
How can i get help here please (Vercel, do they support us here in troubleshooting)?
https://www.srktrends.com/
Yesterday, I tried, but it didn't work. So I've tried and deployed onto Vercel and it worked in one go!.
Now, when I am making any changes to the code and pushing to the github - this is getting updated but vercel it taking the latest code - I tried redployment so many times and it says deployment is successful but with the same old content/code.
How can i get help here please (Vercel, do they support us here in troubleshooting)?
https://www.srktrends.com/
@American black bear