Trying to get a clear picture of nginx integration #161
-
|
Hi @acouvreur Thank you for this project! I went through all the docs and I'm trying to understand how to integrate it with my existing nginx setup. Would appreciate if you could shed some light My docker-compose.yml sablier.yml nginx.conf conf.d/personal.conf
Everything is up and running (no errors). Now the expectation is - if the Error in nginx logs If whoami_container is already running then there is no issue but if I manually stop and try to navigate to the page, nothing happens. Is there any fault in my config? EDIT: SOLUTION Updating the following in Question: After the container was up, the url in browser is still EDIT: SOLUTION Updated the following in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Hello @vutsalsinghal ! You are using ip addresses instead of containers name inside your config. This might work for sablier and for whoami because its on network_host. But be aware that I did this in the doc: # A named location that can be used by the sablier middleware to redirect
location @whoami {
# Use variable in order to refresh DNS cache
set $whoami_server whoami;
proxy_pass http://$whoami_server:80;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}Because containers are getting started, stopped on an endless loop. They will have an IP change, if you do not do that, it will stop working at some point because nginx will keep using the cached IP address. At least that's what I've figured out. |
Beta Was this translation helpful? Give feedback.
-
|
Actually there is an issue when using groups! The group are not correctly built iinto the request! So there is indeed a bug, are you sure found a solution? Here we can see the group getting retrieved But here Group is not used! So I have to fix that |
Beta Was this translation helpful? Give feedback.
Actually there is an issue when using groups!
The group are not correctly built iinto the request! So there is indeed a bug, are you sure found a solution?
https://github.com/acouvreur/sablier/blob/4fd8a24e4c526d2e27cc26d93420ff5c4614cd74/plugins/nginx/njs/sablier.js#L41-L47
Here we can see the group getting retrieved
But here
https://github.com/acouvreur/sablier/blob/4fd8a24e4c526d2e27cc26d93420ff5c4614cd74/plugins/nginx/njs/sablier.js#L76-L85
Group is not used! So I have to fix that