-
I am using odoo with docker. everything was working fine with the automatic config. I want to use the port 8072 of the container to enable longpolling on my odoo environment,
to the config file. im asuming its by creating the file sub.domain.com in the here is what the file i created looks like.
UPDATE
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hello, would you mind sharing your ngix config file and the mapping you did in the docker volume? Did you find a way to not hardcode the container IP? |
Beta Was this translation helpful? Give feedback.
-
I made it work, I was putting the nginx volume in the domain container itself instead of the nginx-proxy container. The only problem I have is the hardcoded IP. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the long reply, i made it work by changing the base configuration file. the code i added is not really a model to follow, i didint know what i was doing, it was trial and error to understand what did what but it works, it adds a config to every containers for longpooling to port 8072. Like i said im sure you could tweak this idea to use the environment variables and not add the port blindly to every containers. |
Beta Was this translation helpful? Give feedback.
-
I am also looking for a way not to hardcode container IP in virtualhost_location file. Is it possible to refference it inside _location file without modifying nginx.tmpl? |
Beta Was this translation helpful? Give feedback.
Sorry for the long reply, i made it work by changing the base configuration file.
/app/nginx.tmpl
i modified the function to create upstreams, to accept a port from the code and called it with a hard codded port.
in my case this file will never be changed so i does not really matter that it is hard coded. Im sure you could make something really nice by using environment variables, like
SecondPort1 = 123
andSecondPortName = Name
(its not real code) or something like this.here is one of my call to add the second port. (the function was changed so it wont work by default for you)
{{ template "upstream" (dict "Upstream" $longpolling "Containers" $containers "Networks" $CurrentContainer.Netw…