Using nginx as proxy from http to https

Hello,

I’m trying to use nginx as a proxy server that should dispatch HTTP
requests
to remote HTTPS server. Here are some configuration details which I’m
using:

    location /test_server {
            proxy_pass

https://testserver.testdomainserver.com:9090/;
proxy_set_header X-Real-IP $remote_addr;
}

The problem is that when I send request to the nginx server I get 505
error
from remote server. If I execute the request directly to the remote
server
it works as expected. Some additional details that I can provide is that
the
remote server is using basic authorization and only accepts requests
through
HTTPS.

I also tried to bind server on port 443 with ssl on and certificates
added,
but when I try to use it, I get the following error:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify
failed

The configuration steps which I tried are explained in:
http://wiki.nginx.org/HttpSslModule

Any idea how can I make it work ?

Posted at Nginx Forum:

On Thu, Oct 25, 2012 at 10:17:08AM -0400, mgenov wrote:

Hi there,

    location /test_server {
            proxy_pass

https://testserver.testdomainserver.com:9090/;
proxy_set_header X-Real-IP $remote_addr;
}

The problem is that when I send request to the nginx server I get 505 error
from remote server. If I execute the request directly to the remote server
it works as expected.

HTTP 505 means HTTP Version Not Supported.

What version do you use when you execute the request directly?

What version does nginx use?

Do you see a different response from

curl -i -k https://testserver.testdomainserver.com:9090/

and

curl -i -k -0 https://testserver.testdomainserver.com:9090/

?

Good luck,

f

Francis D. [email protected]

Actually it returns error 500. Here is the log information from
access.log

[25/Oct/2012:18:44:10 +0300] “POST /testurl/testservice HTTP/1.1” 500 75
“-”
“-”

Here is my version.

nginx -v
nginx version: nginx/0.7.67

In a few minutes I’ll try with curl and will post the result.

and


nginx mailing list
[email protected]
nginx Info Page

Posted at Nginx Forum:

I’ve update my version to: nginx: nginx version: nginx/1.0.5 and it
seems
that the result is similar. Any other ideas ?

Andre J. Wrote:

Don’t sure, wether this is the problem …
[email protected]
nginx Info Page

Posted at Nginx Forum:

2012/10/25 mgenov [email protected]:

Here is my version.

nginx -v
nginx version: nginx/0.7.67

Your version looks outdated …

2012-09-25 nginx-1.2.4 stable version has been released. (See:
http://nginx.org/)

Don’t sure, wether this is the problem …
Well, this is the oldest announcement I’ve found:

2009-12-15 nginx-0.8.30 development version has been released. (See:
nginx news: 2009)

So your versions seems to be REALLY old!

Regards, Andre