Penpot behind a reverse proxy - websockets

Hello Penpot developers and users,

I’m running Penpot behind a Apache reverse proxy.
Does Penpot use websockets and do I need to add some configuration for this?

For OpenVSCode I use:

    RewriteEngine On
    RewriteCond %{HTTP:Connection} Upgrade [NC]
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteRule /(.*) ws://localhost:2999/$1 [P,L]

Do I need to add something similar?

Are there any other problems I can expect from using Penpot behind a reverse proxy?


Yours sincerely,

Verhoeckx

Yes, I can’t found any infos about configuration on apache, but I have got example conf from diffrent project - work for me, websockets with notifications normally connect, there is code: (only change ‘your-address’ to your penpot ip:port)


ProxyPreserveHost On
    ProxyRequests off
    ProxyPass / http://your-address/
    ProxyPassReverse / http://your-address/
    ProxyPass /ws ws://your-address/ws
    ProxyPassReverse /ws ws://your-address/ws

    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)  ws://your-address/$1 [P,l]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /(.*)  http://your-address/$1 [P,l]

Hello @Sataris,

Thanks for the code!

I wonder however, which Apache directives are necessary and which aren’t. It would be great if there was some official documentation about this. And having said that: does Penpot use websockets at all? If they don’t, then our code isn’t necessary at all. So far, the application seems to work fine, but I haven’t used all functionality yet.

Verhoeckx

For people who will find this thread, I used the code below to proxy the websockets.

    RewriteEngine On
    RewriteCond %{HTTP:Connection} Upgrade [NC]
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteRule /(.*) ws://localhost:9001/$1 [P,L]
1 Like