i have deployed a nextjs app on AWS ec2 instance running ubuntu and nginx
using pm2 to run nextjs
the proxy pass entry in nginx conf is like
location / {
# reverse proxy for next server
proxy_pass http://127.0.0.1:3000;
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;
include /etc/nginx/mime.types;
# we need to remove this 404 handling
# because next's _next folder and own handling
# try_files $uri $uri/ =404;
}
My problem is that when I specify port in the ip like http://10.20.30.40:3000 my site comes up properly with all css and javascript loaded
but when no port is specified like http://10.20.30.40 my css and javascript are not loaded and I can see only text
What is wrong? Any help will be highly appreciated. Thanks