-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Funny resource URL prefix disallows using locust behind nginx proxy #2030
Comments
I’m not sure why someone decided on using that format. See if you can find who originally did that (in the git history) and ping them here. makes sense so change it I guess. |
References: |
The reason for the patch was to be able to have Locust behind K8s' ingress (see PR's discussion). And it helped. |
(as mentioned in #2071 ) The leading Doing that could cause issues for k8s users (as mentioned there), but I think it is not really the right solution. |
This happens when your url doesn't end with slash so browser removes last slug in the url when using relative urls (like removing filename from filesystem path). Removing
With trailing slash:
So easiest way to make it work is to use mandatory slash in your nginx rule like this I think that this can be fixed by using HTML tag in the html head, but then the question is what would you use for href attribute since you can also have multiple base urls/paths... |
Can this issue be considered fixed or is there something more we need to do in locust? |
I guess it is fixed |
I am trying to hide locust behind nginx using the following location stanza in nginx config:
You will see that I rewrite all requests that arrive to
/my_path/locust
to/
so that locust will recognize them.It sort of works, but all the resources loaded from the page somehow wants to fetch from
/my_path/static
instead of/my_path/locust/static
which breaks the whole page.When looking at the source of the locust page the reason becomes apparent. For some reason resources are prefixed with
./static/*
. This is the start of the source for reference:Notice how favicon is fetched from
./static/img/favicon.ico
for example.This seems like a strange convention that creates trouble when trying to front locust with a reverse proxy like nginx. I hereby request that resource URLs are converted to be relative. It would simply be a matter of removing the
./
from the resources in question.I don't mind writing a merge request if that is welcome.
The text was updated successfully, but these errors were encountered: