Get help from the marimo community

Updated 4 months ago

Serving Marimo app with Apache2 reverse proxy?

At a glance

The community member is evaluating Marimo and wants to set up a reverse proxy to run it alongside an existing Apache server. The community members provide some guidance, including a link to Marimo's documentation on proxy settings. The community member then shares the specific Apache configuration they used to get it working, which includes setting up a VirtualHost, handling WebSocket support, and starting Marimo with the --base-url option. The community members indicate they may update their documentation with this example configuration.

Useful resources
Hi,
just evaluating Marimo, and it looks very nice, but I'm trying to serve an app in a host that is already running an Apache server, so I was hoping to set a Reverse Proxy to Marimo, but so far with no luck. Is there some documentation out there to the right configuration for this situation?
M
A
5 comments
Can you let me know if this works and if we could update our docs (with maybe a minimal example of your setup)
I had seen that proxy setting option, but I was not sure how to get it to work. In the end, by modifying the Apache server configuration I was able to get it to work nicely (my previous attempts failed apparently because I didn't have the proxy_wstunnel module enabled)
Ah yes we use websockets. Is there anything we can add to our docs for this? Could you share the minimal configuration needed to get it working?
This is my setting to get it to work. In the server where Apache is running, I modify the Apache configuration file to define a VirtualHost as follows:
ProxyPass /marimo http://127.0.0.1:2718/marimo nocanon ProxyPassReverse /marimo http://127.0.0.1:2718/marimo ProxyPreserveHost on # WebSocket support RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/marimo/(.*) "ws://localhost:2718/marimo/$1" [P,L] # # Additional headers that might be useful <Location /marimo> ProxyPassReverseCookiePath / /marimo RequestHeader set X-Forwarded-Proto "http" RequestHeader set X-Forwarded-Port "80" RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s" </Location>

and then I start Marimo with:

marimo edit --base-url /marimo

I tried without the --base-url option, but then it looks like some files are not found. Setting --base-rul to /marimo and then adding it in the URL when defining the VirtualHost all works beautifully.
Add a reply
Sign up and join the conversation on Discord