# Correct nginx proxy pass config

**URL:** <https://help.nextcloud.com/t/correct-nginx-proxy-pass-config/10883>\
**Category:** 📄 Office\
**Tags:** collabora-online\
**Created:** [March 31, 2017, 9:51am UTC](https://help.nextcloud.com/t/correct-nginx-proxy-pass-config/10883 "2017-03-31T09:51:41Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![scryver](https://help.nextcloud.com/letter_avatar/scryver/32/6_22734026db12803ebb3e059622ac3534.png) [@scryver](https://help.nextcloud.com/u/scryver)\
**Post date:** [April 12, 2017, 6:18pm UTC](https://help.nextcloud.com/t/correct-nginx-proxy-pass-config/10883/8 "2017-04-12T18:18:35Z")

</div>

Here it is. I think the upstream part is also important for letting nginx pass the uri unchanged (no url decode)

```
upstream collada-office {
    server 127.0.0.1:9980;
}

server {
    listen 443 ssl;
    server_name office.example.com;
 
    ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;

    # static files
    location ^~ /loleaflet {
        proxy_pass https://collada-office;
        proxy_set_header Host $host;
    }

    # WOPI discovery URL
    location ^~ /hosting/discovery {
        proxy_pass https://collada-office;
        proxy_set_header Host $host;
    }

    # Main websocket
    location ~ /lool/(.*)/ws$ {
        proxy_pass https://collada-office;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 36000s;
    }

    # Admin Console websocket
    location ^~ /lool/adminws {
	proxy_buffering off;
        proxy_pass https://collada-office;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 36000s;
    }

    # download, presentation and image upload
    location ~ /lool {
        proxy_pass https://collada-office;
        proxy_set_header Host $host;
    }
}
```

---

_[View the full topic](https://help.nextcloud.com/t/correct-nginx-proxy-pass-config/10883)._
