crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 275 forks source link

Web service tree configuration and path matching #1419

Open oberstet opened 6 years ago

oberstet commented 6 years ago

Here is how Nginx can be configured to reverse proxy to Jupyter:

        location / {
            proxy_pass http://jupyter;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
     location ~* /(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/? {
            proxy_pass http://jupyter;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # WebSocket support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;

       }

source: https://gist.github.com/cboettig/8643341bd3c93b62b5c2


this has a regex to exactly match what paths are to be reverse proxied with websocket:

/(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/?

to replicate that, we need 2 things:

ecorm commented 5 years ago

To replicate nginx, you would also need to loosen path character restrictions. See #308