自建cpa反代后使用image2生图60s报错504的原因和解决办法

2026-04-29 09:421阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

我的cpa是挂在了自己的vps上,反代了一个域名,一直用着都好,最近image2可以用了,用来生图发现复杂图片用时超过60s必报错:
cpa returned 504: <html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>openresty</center> </body> </html>

image1196×716 30.3 KB
刚开始以为是cpa的原因,更新调节内部参数,都没有效果。
最后让grok帮我搜索,终于发现问题出在了反代上,Nginx 默认 proxy_read_timeout、proxy_send_timeout、proxy_connect_timeout 就是 60 秒,不配置的话一到时间就会 504。
我是1panel上OpenResty反代的,在配置->反向代理->源文中添加下面的内容就解决问题了。

proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 600s; send_timeout 600s;

可以愉快的玩耍了!

telegram-cloud-photo-size-5-6296222795683270489-w1024×1536 264 KB

本小白让ai解决也是绕了好几个弯子才找到问题所在,发给各位佬避免走弯路。

阅读全文
问题描述:

我的cpa是挂在了自己的vps上,反代了一个域名,一直用着都好,最近image2可以用了,用来生图发现复杂图片用时超过60s必报错:
cpa returned 504: <html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>openresty</center> </body> </html>

image1196×716 30.3 KB
刚开始以为是cpa的原因,更新调节内部参数,都没有效果。
最后让grok帮我搜索,终于发现问题出在了反代上,Nginx 默认 proxy_read_timeout、proxy_send_timeout、proxy_connect_timeout 就是 60 秒,不配置的话一到时间就会 504。
我是1panel上OpenResty反代的,在配置->反向代理->源文中添加下面的内容就解决问题了。

proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 600s; send_timeout 600s;

可以愉快的玩耍了!

telegram-cloud-photo-size-5-6296222795683270489-w1024×1536 264 KB

本小白让ai解决也是绕了好几个弯子才找到问题所在,发给各位佬避免走弯路。

阅读全文