# Rancher 2 GUI behind nginx proxy

**URL:** <https://forums.suse.com/t/rancher-2-gui-behind-nginx-proxy/13953>\
**Category:** SUSE Rancher Prime\
**Created:** [April 15, 2019, 9:11am UTC](https://forums.suse.com/t/rancher-2-gui-behind-nginx-proxy/13953 "2019-04-15T09:11:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forums.suse.com/u/sergey)\
**Post date:** [April 15, 2019, 9:11am UTC](https://forums.suse.com/t/rancher-2-gui-behind-nginx-proxy/13953/1 "2019-04-15T09:11:39Z")

</div>

Hello.

I’m using nginx as proxy to rancher GUI. It seems to work, until i try to download/edit .yml files.  
Chrome giving me an error: net::ERR\_INCOMPLETE\_CHUNKED\_ENCODING 200 (OK).

In nginx error log i get:  
2019/04/15 11:49:23 [error] 26480#26480: \*7 upstream prematurely closed connection while sending to client, client: 11.22.33.44, server: server.name, request: “GET /v3/project/c-lhfkr:p-mkbzk/pods/default:tomcat-6bb6b8d448-8rnps/yaml HTTP/1.1”, upstream: “[https://92.168.100.15:443/v3/project/c-lhfkr:p-mkbzk/pods/default:tomcat-6bb6b8d448-8rnps/yaml](https://92.168.100.15:443/v3/project/c-lhfkr:p-mkbzk/pods/default:tomcat-6bb6b8d448-8rnps/yaml)”, host: “server.name”, referrer: “[https://server.name/p/c-lhfkr:p-mkbzk/workload/deployment:default:tomcat](https://server.name/p/c-lhfkr:p-mkbzk/workload/deployment:default:tomcat)”

Here is my nginx conf:

> ```
> server {
> listen 443 ssl;
> server_name server.name;
> 
> client_max_body_size 0;
> chunked_transfer_encoding on;
> 
> ssl_certificate /home/ubuntu/.acme.sh/server.name/fullchain.cer;
> ssl_certificate_key /home/ubuntu/.acme.sh/server.name/server.name.key;
> 
> location / {
> 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_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "Upgrade";
> proxy_buffering off;
> 
> proxy_pass https://192.168.100.15:443;
> }
> 
> ```

If i open rancher GUI without using proxy - it works. But i believe that “upstream prematurely closed connection” means that rancher server closed connection. What can be done?

---

<div class="post-metadata">

**Author:** ![Stonedge](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@Stonedge](https://forums.suse.com/u/Stonedge)\
**Post date:** [April 24, 2019, 8:57pm UTC](https://forums.suse.com/t/rancher-2-gui-behind-nginx-proxy/13953/2 "2019-04-24T20:57:36Z")

</div>

I’ve tried the connection “Upgrade” of nginx without ever reach success… (close but no candy) …

you should probably add proxy\_read\_timeout ####;

I’ved finaly set up an dedicated nginx with the stream module as described in the documentation… and that one work like a charme… I was probably missing a detail,

Stonedge

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forums.suse.com/u/sergey)\
**Post date:** [April 29, 2019, 12:21pm UTC](https://forums.suse.com/t/rancher-2-gui-behind-nginx-proxy/13953/3 "2019-04-29T12:21:27Z")

</div>

Yep. I rewrtie my nginx conf aacording to the guide [https://rancher.com/docs/rancher/v2.x/en/installation/single-node/single-node-install-external-lb/](https://rancher.com/docs/rancher/v2.x/en/installation/single-node/single-node-install-external-lb/) and now everything is work.
