大网数据广告活动
服务器运维问答

nodejs proxied from apache: The proxy server received an invalid response from an upstream server

· 52CE 我爱测

I have nodejs server and some static content to serve. I am using apache 2.4 for this purpose as I need to configure multiple hosts on same machine. I have following configuarion for my virtual host in my apache 2.4 <IfModule mod…

问题原文

原帖链接 · nikhil mehta · CC BY-SA 3.0

I have nodejs server and some static content to serve. I am using apache 2.4 for this purpose as I need to configure multiple hosts on same machine.

I have following configuarion for my virtual host in my apache 2.4

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin [email omitted]
    ServerName mydomain.co.in
    ServerAlias mydomain.co.in
    ProxyPass /api http://127.0.0.1:3001/api
    ProxyPassReverse /api http://127.0.0.1:3001/api
    DocumentRoot /root/VEFA-test-admin/vefa-admin/platforms/browser/www
    <Directory /root/VEFA-test-admin/vefa-admin/platforms/browser/www>
                Options -Indexes +FollowSymLinks +MultiViews
                AllowOverride All
                Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/encrypt/live/mydomain.co.in/fullchain.pem
SSLCertificateKeyFile /etc/encrypt/live/mydomain.co.in/privkey.pem
</VirtualHost>
</IfModule>

And my nodejs server is running on portt 3001 on same machine. The problem is user who will be access my site using mydomain.co.in gets to see the page. But in one scenario I am redirecting user to payment gateway and payment gateway is redirecting user bak on my site after payment. The problem occurs when payment gateway redirects user to my site.

The apache error log says this:

[Thu Sep 07 12:08:06.291298 2017] [proxy_http:error] [pid 12226:tid 139763780601600] (20014)Internal error (specific information not available): [client 219.91.211.175:11159] AH01102: error reading status line from remote server 127.0.0.1:3001, referer: https://test.payumoney.com/payment/postBackParam.do
[Thu Sep 07 12:08:06.291358 2017] [proxy:error] [pid 12226:tid 139763780601600] [client 219.91.211.175:11159] AH00898: Error reading from remote server returned by /api/u/payments/success, referer: https://test.payumoney.com/payment/postBackParam.do

What wrong am I doing here??

I have tried all solutions I am mentioning below

I have tried to use Keepalive on,ProxyBadHeader Ignore but nothing helped me out. Can some one help me?

已采纳解答

原帖链接 · womble · CC BY-SA 3.0

The app being proxied to is not speaking valid HTTP. Whatever is coming back from the nodejs process in response to the HTTP request that Apache is making is not HTTP. I'm not sure how else to explain it...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。