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
URL rewriting functionality #133
Comments
You can use I use that for grafana. Here is an example:
Grafana can be accessed via |
@mbaig25 You can find a similar example @hamburml mentioned in https://github.com/vfarcic/docker-flow-stacks/blob/master/metrics/prometheus-grafana-df-proxy.yml#L49 |
@hamburml @vfarcic thank you for responding so quickly you guys are awesome. I've been trying your suggestions and the URL does get replaced but I keep getting 503 from docker-flow-proxy. Here are the commands I tried with same result: docker service create \
--name kibana \
--network proxy \
--network log_net \
--label com.df.notify=true \
--label com.df.distribute=true \
--label com.df.servicePath=/kibana \
--label com.df.port=5601 \
--label com.df.reqPathSearch='/kibana' \
--label com.df.reqPathReplace='/' \
--constraint 'node.labels.logger == true' \
kibana docker service create \
--name kibana \
--network proxy \
--network log_net \
--label com.df.notify=true \
--label com.df.distribute=true \
--label com.df.servicePath=/kibana/ \
--label com.df.port=5601 \
--label com.df.reqPathSearch='/kibana/' \
--label com.df.reqPathReplace='/' \
--constraint 'node.labels.logger == true' \
kibana docker service create \
--name kibana \
--network proxy \
--network log_net \
--env SERVER_BASEPATH="%(protocol)s://%(domain)s:%(http_port)s/kibana" \
--label com.df.notify=true \
--label com.df.distribute=true \
--label com.df.servicePath=/kibana \
--label com.df.port=5601 \
--label com.df.reqPathSearch='/kibana' \
--label com.df.reqPathReplace='/' \
--constraint 'node.labels.logger == true' \
kibana docker service create \
--name kibana \
--network proxy \
--network log_net \
--env SERVER_BASEPATH="%(protocol)s://%(domain)s:%(http_port)s/app/kibana" \
--label com.df.notify=true \
--label com.df.distribute=true \
--label com.df.servicePath=/kibana \
--label com.df.port=5601 \
--label com.df.reqPathSearch='/kibana' \
--label com.df.reqPathReplace='/' \
--constraint 'node.labels.logger == true' \
kibana I'm not sure why its not being passed through. Then again I've been at this for the past couple days so I might be missing something completely obvious. Here is the haproxy config:
Thanks again. |
Here are the commands I executed. I put comments before each. # Clone the repo with Docker stacks.
git clone https://github.com/vfarcic/docker-flow-stacks
cd docker-flow-stacks/logging
docker network create --driver overlay proxy
docker network create --driver overlay log_net
# Deploy Docker Flow Proxy and Docker Flow Swarm Listener
docker stack deploy -c ../proxy/docker-flow-proxy.yml proxy
# Kibana is special. It does not have a unique path so multiple need to be defined as the servicePath label. Those used below are the paths used by Kibana.
docker service create \
--name kibana \
--network proxy \
--network log_net \
--label com.df.notify=true \
--label com.df.distribute=true \
--label com.df.servicePath=/app,/elasticsearch,/api,/ui,/bundles,/plugins \
--label com.df.port=5601 \
kibana
open "http://localhost/app/kibana"
# UI works but it shows a warning since ElasticSearch is not running.
docker service rm kibana
# The same thing but through a stack file together with ElasticSearch, LogSpout, and LogStash
docker stack deploy -c logging-df-proxy.yml logging
open "http://localhost/app/kibana"
# UI works
docker stack rm logging
docker stack rm proxy The problem with having all those paths (e.g. /app, /api, and so on) is that there might be a different application that uses the same paths. Ideally, Kibana (and any other app), should have a single (potentially unique) path or have it customizable through environment variables. Unfortunately, Kibana is not one of those :( So, all those paths need to be present. Normally, I would run Kibana on a separate domain. In that case, it would not matter what the path is and labels would be something like:
Please note that the path is, this time, Please let me know whether one of those solutions fits your use case. If they don't we can explore other options. |
@vfarcic Thank you. The paths in your command and option with the service domain solved the issue. I'll close it now. Just curious though, how did you go about finding out the paths that are required by Kibana? Would just like to know. 😄 Thanks again to both of guys. |
I find out about the paths by inspecting network traffic through Chrome :) |
@vfarcic Ah simpler than I thought |
Can there possible be a label to specifiy that the backend config that generated should rewrite the base path from the frontend.
Currently having an issue where I'm trying to put kibana behind the docker-flow-poxy but apparently it requires a url rewrite.
The text was updated successfully, but these errors were encountered: