admin管理员组文章数量:1335600
I have a Next.js website I'm trying to deploy, but the login form is broken on the production server, and whenever I submit my login information it returns a 402 bad gateway. It uses Nginx for the reverse proxy. My Nginx Config:
server {
listen 80;
server_name [my ip];
location /{
proxy_pass http://localhost: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;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/site/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.site) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = site) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name site www.site;
return 404; # managed by Certbot
Nginx access logs
ip - - [19/Nov/2024:23:03:20 +0000] "POST /account/login HTTP/1.1" 502 568 "https://site/account/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
I tried increasing the nginx proxy buffer size, the timeout. But nothing works.
本文标签: nginx502 Bad gateway on html POST form submissionStack Overflow
版权声明:本文标题:nginx - 502 Bad gateway on html POST form submission - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742393111a2466382.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论