<div dir="ltr"><div>It looks like HP has decided to only support HTTP 1.0 or HTTP 1.1 on this printer, though it is not clear which one they are using since you didn't show the headers of your request direct to the printer.</div><div><br></div><div>If you do `curl -v <a href="http://192.168.1.XX">http://192.168.1.XX</a>` it will show you the headers, which include the HTTP version that was used.</div><div>It will be either 1.0 or 1.1.</div><div><br></div><div>You can then use the `proxy_http_version` directive like this (substitute 1.1 for 1.0 if needed) to force the version used:</div><div><br></div><div><font face="monospace">server {<br>    listen 80;<br>    access_log /var/log/nginx/localhost.access_log main;<br>    error_log /var/log/nginx/localhost.error_log debug;<br><br>    location /printer/ {<br>        proxy_pass <a href="http://192.168.1.XX/">http://192.168.1.XX/</a>;</font></div><div><font face="monospace">        proxy_http_version 1.1;<br>    }<br>}<br></font></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div><div dir="ltr"><br></div><div>Moshe</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 6, 2020 at 3:29 AM Willy Gardiol <<a href="mailto:willy@gardiol.org">willy@gardiol.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi all!<br>
first time poster here so please excuse my manners and correct me where <br>
i am wrong.<br>
<br>
I use NGINX 1.16.1 on Gentoo as reverse proxy server to expose some <br>
services to an external web site.<br>
<br>
I am exposing many things but one is giving me headaches.<br>
<br>
I am trying to expose the web UI of an HP network printer.<br>
<br>
I have this in my nginx.conf (trimming lines to the ones relevant):<br>
server {<br>
                 listen 80;<br>
                 access_log /var/log/nginx/localhost.access_log main;<br>
                 error_log /var/log/nginx/localhost.error_log debug;<br>
<br>
                 location /printer/ {<br>
                         proxy_pass <a href="http://192.168.1.XX/" rel="noreferrer" target="_blank">http://192.168.1.XX/</a>;<br>
                 }<br>
}<br>
<br>
I can access the printer from the proxy server, no problems, with:<br>
curl <a href="http://192.168.1.XX" rel="noreferrer" target="_blank">http://192.168.1.XX</a><br>
<br>
But if i try, on the same proxy server this:<br>
curl <a href="http://127.0.0.1/printer/" rel="noreferrer" target="_blank">http://127.0.0.1/printer/</a><br>
<br>
I get the error:<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 connect to 192.168.1.XX:80, <br>
fd:11 #3<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream connect: -2<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http finalize request: -4, <br>
"/printer/?" a:1, c:2<br>
[snip]<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http run request: "/printer/?"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream check client, <br>
write event:1, "/printer/"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream request: <br>
"/printer/?"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream send request <br>
handler<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream send request<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream send request body<br>
[snip]<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream request: <br>
"/printer/?"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http upstream process header<br>
[snip]<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy status 505 "505 HTTP <br>
Version not supported"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header: <br>
"X-Content-Type-Options: no-sniff"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header: <br>
"Cache-Control: no-cache, no-store, must-revalidate"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header: "Server: <br>
gSOAP/2.7"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header: <br>
"Content-Length: 0"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header: "Connection: <br>
close"<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 http proxy header done<br>
2020/03/06 08:42:02 [debug] 12870#0: *2 HTTP/1.1 505 HTTP Version not <br>
supported^M<br>
<br>
So my guess NGINX is doing something which the web printer does not <br>
like...<br>
<br>
What could i try or do?<br>
<br>
thank you for your time and response.<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
Willy Gardiol<br>
<a href="mailto:willy@gardiol.org" target="_blank">willy@gardiol.org</a><br>
<a href="http://www.gardiol.org" rel="noreferrer" target="_blank">www.gardiol.org</a><br>
<a href="http://www.trackaway.org" rel="noreferrer" target="_blank">www.trackaway.org</a> -> Track YOUR way the way you want!<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>