Forum: NGINX Error when configuring reverse proxy to HTTPs

2974d09ac2541e892966b762aad84943?d=identicon&s=25 ricardo.ekm (Guest)
on 2014-08-27 19:38
(Received via mailing list)
Hi All,
I'm trying to configure a reverse proxy in Nginx, which receives a HTTP
request and call a HTTPS URL. When we change the config to call a HTTP
it
works fine, however it doesn't work with HTTPS. The http_ssl_module is
installed.

Here is the error:
 <HTML><HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD><BODY>
<H1>Invalid URL</H1>
The requested URL
"&#47;buy&#45;later&#47;buy&#45;later&#47;&#63;customerId&#61;123123",
is
invalid.<p>
Reference&#32;&#35;9&#46;9cd8f648&#46;1409160431&#46;4f0536
</BODY></HTML

Here goes the current version:
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-16ubuntu6)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security
-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions
-Wl,-z,relro'
--prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf
--http-log-path=/var/log/nginx/access.log
--error-log-path=/var/log/nginx/error.log
--lock-path=/var/lock/nginx.lock
--pid-path=/run/nginx.pid
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit
--with-ipv6 --with-http_ssl_module --with-http_stub_status_module
--with-http_realip_module --with-http_addition_module
--with-http_dav_module
--with-http_geoip_module --with-http_gzip_static_module
--with-http_image_filter_module --with-http_spdy_module
--with-http_sub_module --with-http_xslt_module --with-mail
--with-mail_ssl_module


Here goes the config:
  server {
    listen 80;
    server_name localhost;

    location /api/v1/buy-later {
      proxy_pass https://checkout.mysite.com.br/buy-later/buy-later;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header User-Agent $http_user_agent;
    }
  }

Any help is appreciated. Thanks!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,252902,252902#msg-252902
Ebfa54c92a50798dfdbbdb4e28ed1f29?d=identicon&s=25 Richard Kearsley (Guest)
on 2014-08-27 20:34
(Received via mailing list)
Hi

The error you supplied appears to be coming from the backend itself
so the proxy_pass is actually working

Check with your backend logs to find out if the url requested is not
what you expected.. and why the url is invalid

Richard
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ricardo.ekm (Guest)
on 2014-08-27 21:30
(Received via mailing list)
Yes, you're right. The problem was in the backend. We fixed it up and it
worked.

Thanks.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,252902,252908#msg-252908
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.