You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by max <ma...@gmail.com> on 2016/12/12 13:16:48 UTC
httpd reverse-proxy reply 502 bad gateway
Hi,
I'm facing a 502 bad gateway error from my httpd proxy.
My use case is pretty simple, just PUT an image as attachment twice. Then
the second request is facing a revision conflict but I get the 502 error
instead of a JSON error response.
The request I use :
PUT
/database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
HTTP/1.1
// 1st response is a json ok response
PUT
/database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
HTTP/1.1
// 2nd response is 502 bad gateway html file
To set up my proxy I used
https://wiki.apache.org/couchdb/Apache_As_a_Reverse_Proxy
You can see my httpd conf below.
Thanks for any hints.
CouchDB 1.4.
CentOS 6
httpd.conf :
AllowEncodedSlashes On
ProxyRequests Off
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
ServerName servtest.com
ProxyPass / http://localhost:5984/ nocanon
ProxyPassReverse / http://localhost:5984/
ssl.conf :
AllowEncodedSlashes On
ProxyRequests Off
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
ServerName servtest.com
ProxyPass / http://localhost:5984/ nocanon
ProxyPassReverse / http://localhost.com:5984/
SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile /etc/httpd/certs/servtest.crt
SSLCertificateKeyFile /etc/httpd/certs/servtest.key
SSLCertificateChainFile /etc/httpd/certs/DigiCertCA.crt
Max
Re: httpd reverse-proxy reply 502 bad gateway
Posted by max <ma...@gmail.com>.
Hi,
Thanks for tour answer I've already try it. Like you I tougth ::1 was the
problème for IpV6 but if it was I'd got the same problem for all my request
a'd not only conflict when uploading attachment...
Do you see anything else I could try?
Le 12 déc. 2016 7:07 PM, "Joan Touzet" <wo...@apache.org> a écrit :
> Try changing
>
> localhost:5984
>
> to
>
> 127.0.0.1:5984
>
> in your Apache configuration.
>
> The fail message from your Apache proxy suggests it is trying to
> bind to an IPv6 localhost address, and I'm not 100% convinced this
> works with CouchDB.
>
> -Joan
>
> ----- Original Message -----
> > From: "max" <ma...@gmail.com>
> > To: user@couchdb.apache.org
> > Sent: Monday, December 12, 2016 8:33:53 AM
> > Subject: Re: httpd reverse-proxy reply 502 bad gateway
> >
> > Sorry for double,
> >
> > I forgot to write httpd log :
> >
> >
> > [Mon Dec 12 14:24:08 2016] [error] (103)Software caused connection
> > abort:
> > proxy: pass request body failed to [::1]:5984 (localhost)
> > [Mon Dec 12 14:24:08 2016] [error] proxy: pass request body failed to
> > [::1]:5984 (localhost) from x.x.x.x ()
> >
> > x.x.x.x being my public IP.
> >
> > 2016-12-12 14:16 GMT+01:00 max <ma...@gmail.com>:
> >
> > > Hi,
> > >
> > > I'm facing a 502 bad gateway error from my httpd proxy.
> > > My use case is pretty simple, just PUT an image as attachment
> > > twice. Then
> > > the second request is facing a revision conflict but I get the 502
> > > error
> > > instead of a JSON error response.
> > >
> > > The request I use :
> > >
> > > PUT
> > > /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef8300
> 46
> > > HTTP/1.1
> > > // 1st response is a json ok response
> > > PUT
> > > /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef8300
> 46
> > > HTTP/1.1
> > > // 2nd response is 502 bad gateway html file
> > >
> > > To set up my proxy I used https://wiki.apache.org/
> > > couchdb/Apache_As_a_Reverse_Proxy
> > >
> > > You can see my httpd conf below.
> > > Thanks for any hints.
> > >
> > > CouchDB 1.4.
> > > CentOS 6
> > >
> > > httpd.conf :
> > >
> > > AllowEncodedSlashes On
> > > ProxyRequests Off
> > > <Proxy *>
> > > Order Allow,Deny
> > > Allow from all
> > > </Proxy>
> > >
> > > ServerName servtest.com
> > > ProxyPass / http://localhost:5984/ nocanon
> > > ProxyPassReverse / http://localhost:5984/
> > >
> > > ssl.conf :
> > >
> > > AllowEncodedSlashes On
> > > ProxyRequests Off
> > > <Proxy *>
> > > Order Allow,Deny
> > > Allow from all
> > > </Proxy>
> > >
> > > ServerName servtest.com
> > > ProxyPass / http://localhost:5984/ nocanon
> > > ProxyPassReverse / http://localhost.com:5984/
> > > SSLEngine on
> > > SSLProtocol all -SSLv2
> > > SSLCertificateFile /etc/httpd/certs/servtest.crt
> > > SSLCertificateKeyFile /etc/httpd/certs/servtest.key
> > > SSLCertificateChainFile /etc/httpd/certs/DigiCertCA.crt
> > >
> > >
> > > Max
> > >
> >
>
Re: httpd reverse-proxy reply 502 bad gateway
Posted by Joan Touzet <wo...@apache.org>.
Try changing
localhost:5984
to
127.0.0.1:5984
in your Apache configuration.
The fail message from your Apache proxy suggests it is trying to
bind to an IPv6 localhost address, and I'm not 100% convinced this
works with CouchDB.
-Joan
----- Original Message -----
> From: "max" <ma...@gmail.com>
> To: user@couchdb.apache.org
> Sent: Monday, December 12, 2016 8:33:53 AM
> Subject: Re: httpd reverse-proxy reply 502 bad gateway
>
> Sorry for double,
>
> I forgot to write httpd log :
>
>
> [Mon Dec 12 14:24:08 2016] [error] (103)Software caused connection
> abort:
> proxy: pass request body failed to [::1]:5984 (localhost)
> [Mon Dec 12 14:24:08 2016] [error] proxy: pass request body failed to
> [::1]:5984 (localhost) from x.x.x.x ()
>
> x.x.x.x being my public IP.
>
> 2016-12-12 14:16 GMT+01:00 max <ma...@gmail.com>:
>
> > Hi,
> >
> > I'm facing a 502 bad gateway error from my httpd proxy.
> > My use case is pretty simple, just PUT an image as attachment
> > twice. Then
> > the second request is facing a revision conflict but I get the 502
> > error
> > instead of a JSON error response.
> >
> > The request I use :
> >
> > PUT
> > /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
> > HTTP/1.1
> > // 1st response is a json ok response
> > PUT
> > /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
> > HTTP/1.1
> > // 2nd response is 502 bad gateway html file
> >
> > To set up my proxy I used https://wiki.apache.org/
> > couchdb/Apache_As_a_Reverse_Proxy
> >
> > You can see my httpd conf below.
> > Thanks for any hints.
> >
> > CouchDB 1.4.
> > CentOS 6
> >
> > httpd.conf :
> >
> > AllowEncodedSlashes On
> > ProxyRequests Off
> > <Proxy *>
> > Order Allow,Deny
> > Allow from all
> > </Proxy>
> >
> > ServerName servtest.com
> > ProxyPass / http://localhost:5984/ nocanon
> > ProxyPassReverse / http://localhost:5984/
> >
> > ssl.conf :
> >
> > AllowEncodedSlashes On
> > ProxyRequests Off
> > <Proxy *>
> > Order Allow,Deny
> > Allow from all
> > </Proxy>
> >
> > ServerName servtest.com
> > ProxyPass / http://localhost:5984/ nocanon
> > ProxyPassReverse / http://localhost.com:5984/
> > SSLEngine on
> > SSLProtocol all -SSLv2
> > SSLCertificateFile /etc/httpd/certs/servtest.crt
> > SSLCertificateKeyFile /etc/httpd/certs/servtest.key
> > SSLCertificateChainFile /etc/httpd/certs/DigiCertCA.crt
> >
> >
> > Max
> >
>
Re: httpd reverse-proxy reply 502 bad gateway
Posted by max <ma...@gmail.com>.
Sorry for double,
I forgot to write httpd log :
[Mon Dec 12 14:24:08 2016] [error] (103)Software caused connection abort:
proxy: pass request body failed to [::1]:5984 (localhost)
[Mon Dec 12 14:24:08 2016] [error] proxy: pass request body failed to
[::1]:5984 (localhost) from x.x.x.x ()
x.x.x.x being my public IP.
2016-12-12 14:16 GMT+01:00 max <ma...@gmail.com>:
> Hi,
>
> I'm facing a 502 bad gateway error from my httpd proxy.
> My use case is pretty simple, just PUT an image as attachment twice. Then
> the second request is facing a revision conflict but I get the 502 error
> instead of a JSON error response.
>
> The request I use :
>
> PUT /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
> HTTP/1.1
> // 1st response is a json ok response
> PUT /database0/document0/tmpImage.jpg?rev=8-b5b4327c77aea245cf04c9e7ef830046
> HTTP/1.1
> // 2nd response is 502 bad gateway html file
>
> To set up my proxy I used https://wiki.apache.org/
> couchdb/Apache_As_a_Reverse_Proxy
>
> You can see my httpd conf below.
> Thanks for any hints.
>
> CouchDB 1.4.
> CentOS 6
>
> httpd.conf :
>
> AllowEncodedSlashes On
> ProxyRequests Off
> <Proxy *>
> Order Allow,Deny
> Allow from all
> </Proxy>
>
> ServerName servtest.com
> ProxyPass / http://localhost:5984/ nocanon
> ProxyPassReverse / http://localhost:5984/
>
> ssl.conf :
>
> AllowEncodedSlashes On
> ProxyRequests Off
> <Proxy *>
> Order Allow,Deny
> Allow from all
> </Proxy>
>
> ServerName servtest.com
> ProxyPass / http://localhost:5984/ nocanon
> ProxyPassReverse / http://localhost.com:5984/
> SSLEngine on
> SSLProtocol all -SSLv2
> SSLCertificateFile /etc/httpd/certs/servtest.crt
> SSLCertificateKeyFile /etc/httpd/certs/servtest.key
> SSLCertificateChainFile /etc/httpd/certs/DigiCertCA.crt
>
>
> Max
>