someone could help me to run my web app with nextjs 14+ Typescript?
it work under http protrocol and adding port number
http://DOMAIN:3001
but didn`t work using reverse proxy
steps to reproduce:
npx create-next-app@latest
npm install
npm run build
npm install -g pm2
pm2 start npm --name “nextjsapp” – start – -p 3001
pm2 save
pm2 startup
add following rules to VHOST Conf:
rewrite {
enable 1
autoLoadHtaccess 1
}
Redirecionar HTTP para HTTPS
rewritecond %{HTTPS} off
rewriterule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
context / {
type proxy
handler proxy-handler
addDefaultCharset off
proxyPass http://127.0.0.1:3001/
proxySetHeader Host $host
proxySetHeader X-Real-IP $remote_addr
proxySetHeader X-Forwarded-For $proxy_add_x_forwarded_for
proxySetHeader X-Forwarded-Proto $scheme
}
got 403 forbiden access on domain with https://DOMAIN,
but it works with http://DOMAIN:3001