Allow plausible to reside in url folder rather than subdomain #537
-
I want to host plausible under https://example.org/plausible and set the BASE_URL accordingly. However, it seems that such folders are not supported yet. All documentation is talking about "folder-less" domain or subdomain hosting. I used https://plausible.io/docs/self-hosting to set everything up, including reverse proxy. I use reverse proxies for various other tools, so I am quite sure that is working all right. Following screenshot shows that page assets are loaded folder-less, even though BASE_URL is set accordingly: I guess the base_url parameter needs to be systematically placed in every place where resources are called. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
+1! Seems like Plausible ignores |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for reporting. This should be fixed in https://github.com/plausible/analytics/releases/tag/v1.4.0-rc.0. Can someone test and confirm? |
Beta Was this translation helpful? Give feedback.
-
I ran into the same thing: I want Plausible to live as a sub-folder of the main site, but it's really running behind a proxy to a private server behind firewall. My setup: This does work on 1.4-rc.0 but requires some rewriting of HTML responses back to the client. Many of the application links can be rewritten, but some are only assembled at runtime on the client side, so they cannot be rewritten and require additional Apache regex rewrite rules. In case it helps @jbreu here are the rewrite rules working for me, attached. As you can see, the top level "/api" is really the only outstanding problem. Since we do not run anything at example.com/api this works for us, but for others who do have something already at /api they may have a conflict. Also I have the BASE_URL set for Plausible in this case to "http://192.168.1.2:8087/" |
Beta Was this translation helpful? Give feedback.
-
Is there any update on this? I'm trying to get Plausible CE running on something like https://example.com/plausible, but I immediately get redirected to https://example.com/register on launch. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for reporting. This should be fixed in https://github.com/plausible/analytics/releases/tag/v1.4.0-rc.0. Can someone test and confirm?