Domain 1 running, additional services like Node-RED, Grafana and InfluxDB not available #377
-
Hi, I can´t figure out how to get the VIRTUAL_PORT and VIRTUAL_PATH working for me. On my server I want to use the nginx proxy to serve one website at https://subdomain.domain1.de, which is running fine. Then I also want to build an IoT stack to collect and display sensor data with Node-RED, Influxdb and Grafana and expose those services to a second https://subdomain.domain2.de with paths like subdomain.domain2.de/nodered which forwards the request to the port 1880 of the Node-RED service. Usually you would access the service via the IP of the Server and the specified port 1880 to see the webinterface of Node-RED. I made a simple docker-compose.yaml to test it which looks like this:
As a response from my browser I get "Cannot GET /nodered" as Error, when I open https://subdomain.domain2.de/nodered. So it seems the proxy is trying to route the traffic through but can´t reach the container. Is my docker compose file correct or do I need to add/change anything? Thanks in advance for your tipps. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@Martin-Wachsmuth please check this dicussion see if it helps: |
Beta Was this translation helpful? Give feedback.
-
I´ve tried to dig deeper but couldn´t find a solution yet. It seems like the VIRTUAL_PATH is not working as expected. I used the following docker-compose.yml:
but removed subdomain.domain2.de_location_override in 'NGINX_FILES_PATH/data/vhost.d' (mainly to reduce further error sources).
As stated in my first post the service of domain1 is running fine and was started using the To me it seems strange, that both internal IPs and ports of my containers end up in one upstream definition and that there are no special location blocks for my specified paths. This should look different right? I also found this issue report: nginx-proxy/nginx-proxy#1647 which lead to the following pull request: nginx-proxy/nginx-proxy#1607. But since the problem was solved there, it should be solved for this repository as well, since the fresh-start.sh gets it´s nginx.tmpl template from there. Am I overlooking something? I really can´t find the root of my problem. |
Beta Was this translation helpful? Give feedback.
-
I finally got it running and it seems there were multiple problems. To get the services running was a separate task, which wasn´t necessarily problematic from the proxy automation, but from the different apps themselves. InfluxDB (currently) won’t run under a path and is expecting to run under its own domain and in the root path. The easiest way to work around for me was to create its own subdomain influxdb.domain2.de. I wanted to avoid this, but the following discussion indicated, that there seems to be no other easy way: influxdata/influxdb#15721. For grafana it was quite easy. Additionally to the usual configuration in the docker-compose file I had to change some configs for grafana itself following this tutorial: https://grafana.com/tutorials/run-grafana-behind-a-proxy/. Node-RED is still a bit tricky. After starting the service I still get the
to
So the difference is just the slash in the proxy_pass line. I don´t know if there is a way to include the slash automatically. On the other hand it isn´t a big deal to do it. The only thing which is a bit annoying is, to keep that in mind if I add additional websites/services, which would change my default.conf file. I hope this helps others, which might struggle as I did. |
Beta Was this translation helpful? Give feedback.
I finally got it running and it seems there were multiple problems.
First I ran the update-nginx-template.sh from the /nginx-proxy-automation/bin/ folder. This solved my problem regarding individual URL paths and the according upstream blocks in the nginx configuration. Maybe the update didn´t work when I used the fresh-start.sh script. However the nginx template update helped.
To get the services running was a separate task, which wasn´t necessarily problematic from the proxy automation, but from the different apps themselves.
InfluxDB (currently) won’t run under a path and is expecting to run under its own domain and in the root path. The easiest way to work around for me was to create …