Opened 8 years ago

Closed 8 years ago

#10 closed defect (invalid)

// in URI is truncated to / while proxing to real server

Reported by: www.google.com/accounts/o8/id?id=AItOawlNRCBAb5OP6uQ8EYGb7faZ7GAj4pX3ff4 Owned by: somebody
Priority: critical Milestone:
Component: nginx-module Version: 1.1.x
Keywords: proxy uri truncated Cc:
uname -a: FreeBSD svn.localhost.localdomain 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
nginx -V: nginx: nginx version: nginx/1.1.1 nginx: TLS SNI support enabled nginx: configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module --with-pcre

Description

Client send to nginx proxy with URI "/confluence/rest/applinks/1.0/applicationlinkForm/url/http://127.0.0.1:8080/jira.json?_=1315386721160".

But nginx send to real server with incorrect URI "/confluence/rest/applinks/1.0/applicationlinkForm/url/http:/127.0.0.1:8080/jira.json?_=1315386721160".

String "http://127.0.0.1:8080/" is truncated to "http:/127.0.0.1:8080/".

nginx.conf
location /confluence {

proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8090/confluence;
proxy_redirect http://127.0.0.1:8090/confluence/ /confluence/;

}

Attachments (1)

report.txt (558 bytes) - added by www.google.com/accounts/o8/id?id=AItOawlNRCBAb5OP6uQ8EYGb7faZ7GAj4pX3ff4 8 years ago.
The error report automatic convert http://xxx to link

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by www.google.com/accounts/o8/id?id=AItOawlNRCBAb5OP6uQ8EYGb7faZ7GAj4pX3ff4

The error report automatic convert http://xxx to link

comment:1 Changed 8 years ago by mdounin

  • Resolution set to invalid
  • Status changed from new to closed

This is expected behaviour. If you want to pass original URI as provided by client, please use proxy_pass without URI component:

location /confluence {
    proxy_pass http://127.0.0.1:8080;
}

Alternatively, you may use merge_slashes directive, see documentation (in Russian) here:

http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#merge_slashes

This may not be safe though and hence not recommended, see documentation for details.

Note: See TracTickets for help on using tickets.