-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub path installation #174
Comments
This isn't particular to listmonk, but is definitely possible using |
Sadly it is not so easy because the web page access all resources via absolute links (eg Some application are using relative import where this works automatically but it seams not so easy for larger application. I think something similar would be required to get it working in such a setup. |
I took a closer look at this issue and based on my pure understanding of this java script framework it seams not be so easy to support sub path installation. The only option I found at the moment is to make a custom build and change this line listmonk/frontend/vue.config.js Line 2 in 288164e
Sadly a relative path is not working here (links and API calls broken) and it seams also not really possible to set this value dynamically at runtime. |
You are right. The frontend has to be recompiled with tweaked paths. You will also have to tweak the static path ( |
With a little bit of URL rewriting by the reverse proxy it is enough to modify front end. Here an example for traefik (file provider): http:
routers:
listmonk:
rule: "PathPrefix(`/listmonk/`)"
middlewares:
- "test-stripprefix"
service: listmonk
middlewares:
test-stripprefix:
stripPrefix:
prefixes:
- "/listmonk"
services:
listmonk:
loadBalancer:
servers:
- url: http://127.0.0.1:9000/ Too bad that vuejs/webpack does not support such kind of setup. |
@knadh Only to make it clear: This configuration does not fix the problem! This configuration produces the errors shown in my second comment. |
While this is not a feature I need, here's a possible idea to solve it:
To me, it seems a bit of a hacky way to solve it, but AFAIK there is no other way to dynamically change the base url after being built with webpack. I haven't tested any of the above, but just a thought as I came across this issue. Edit: Actually, I think the |
Thanks @justinbeaty, will give this a try. Reopening the issue. |
@knadh If you do want some help on this, just let me know. I didn't mean to just write how you should fix it, but I figured I'd write out an attempted solution to see if it would be acceptable. |
Given that listmonk currently does not support serving URLs from subdirectories, the settings entry in the GUI should be relabeled. That's the text which currently says |
@svenk noted. @justinbeaty I spent a few hours attempting this today. It almost works, but there's still some WebPack/Vue quirk that breaks it. Adding Changing I've the WIP here in case you're interested in checking it out. |
Closing this due to inactivity. The WIP I linked is now stale after the v2.0.0 release. |
Hi, I managed to run listmonk v2.0.0 in a sub path. Setup
ConfigNGINX Config
HAPROXY Config
ContainerRuns listmonk on port 9000. This works for me, but might be helpful to others. I use listmonk as an internal service. There might be more to consider, when using listmonk on a public interface. |
Nice @jhrdt. Why do you need HAProxy on top of Nginx though? Either one of the proxies should be enough right? |
Hi @knadh. Yes this right, you could drop HAProxy. I use it to handle traffic on my container host. A rewrite rule before the proxy_pass could do the same, I think. I could try to do a version, only with nginx and listmonk (both on the same host). |
Hi @knadh, I created a test environment and installed the following software
NGINX ConfigThe following config runs listmonk in sub-path
|
Can I run multiple instance of listmonk with multiple subpath in a kubernetes cluster ? k8s configWith this configuration you can install multiple instance of listmonk with subpath /listmonk/instance Nginx proxy side-car configThis config is mount at /etc/nginx/conf.d/default.conf.template
The envar substitution is done with a configMapRef in envFrom and a custom command :
Ingress controller snippet
|
I just spent a couple hours trying to get this to work, wondering why I was only getting 404s, thinking I had done something wrong. The text implies that it's a simple config option when in-fact, it is not (see all the workarounds that people have made). I really like @svenk's suggestion and it would have saved me all the time debugging. |
We want to use listmonk in an internal network hosted on a server shared by multiple services.
Sadly we don't have the ability to use DNS, instead we are using sub paths to separate services for example:
Is it possible to run listmonk in a similar way?
The text was updated successfully, but these errors were encountered: