Open sergechantave84 opened 1 year ago
Thank you for reaching out. In order to resolve the issue you are experiencing, kindly ensure that you have the following configuration parameter set correctly:
HOST_SERVICE_SEPARATOR=.
Additionally, it is important to confirm that the DNS A record is correctly configured to point from "*.api-dev.espylid.com" to the same host, "api-dev.espylid.com".
Please verify these settings and let us know if the issue persists. Feel free to provide any additional details or logs that could help us further investigate the problem.
@mnofresno : Thank you for your reply
Voici la variable dans .env:
HOST_SERVICE_SEPARATOR=.
api-dev.espylid.com is the vhost defined in nginx on the server, listening on port 80/443
There is a proxy that points it to 127.0.0.1:3080 where 127.0.0.1:3080 denotes the nginx container listening on port 3080/3443
server {
listen 80;
server_name api-dev.espylid.com;
location / {
# auth_basic "Admin area";
# auth_basic_user_file /etc/nginx/.htpasswd;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_cookie_path / "/; secure; HttpOnly; SameSite=lax";
proxy_pass http://127.0.0.1:3080;
}
}
I also realized that there are quite a few problems. From the nginx container: docker exec -it api-gateway2-nginx-1 /bin/sh
My /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.144.3 8b2871be1eff
gateway.api-dev.espylid.com admin.api-dev.espylid.com konga.api-dev.espylid.com does not defined
And When modifying the docker-compose.yml files, the modifications are not supported in container. You have to enter the container to modify the config of the docker ngnix server
There is a proxy that points it to 127.0.0.1:3080 where 127.0.0.1:3080 denotes the nginx container listening on port 3080/3443
Where is that proxy defined? I've searched trough our code and no proxy on that port is defined.
gateway.api-dev.espylid.com admin.api-dev.espylid.com konga.api-dev.espylid.com does not defined
They not need to be defined on nginx container's hosts file because your infrastructure should resolve to the server that is running docker-compose and the only service listening to 80/443 ports is the nginx container's service so an http/https request will be served up by that container and the Host header of the request will help nginx distinguish request coming to each of the 3 endpoints.
And When modifying the docker-compose.yml files, the modifications are not supported in container. You have to enter the container to modify the config of the docker ngnix server
To what modifications do you refer? Our Kong distribution is not meant to be modified that way.
Please make sure your infrastructure has the correct DNS A / CNAME records directed to the server that is running docker-compose.
What DNS infra do you use? Amazon's Route53 or any other?
@matiasditada @mnofresno @gonzadc @jcvincenti Good morning I have a problem on the deployment of konga in production. If you can help me that would be great.
Here are my configs:
.env file
BASE_HOST_DOMAIN=api-dev.espylid.com
By executing the following curl request in the container (
docker exec -it api-gateway2-nginx-1 /bin/sh
):curl -i -X GET --url http://kong:8000/a/ok
return 200 response of my microserviceBut By executing the following curl request in the container:
curl -i -X GET --url http://gateway.api-dev.espylid.com/a/ok
return 404 responseAnd By executing
curl -i -X GET --url http://gateway.api-dev.espylid.com
return 200 responseThis is my /etc/nginx/conf.d/gateway.conf in Nginx container
And my /etc/nginx/conf.d/server_hosts/gateway-url.conf
The config looks good, but it doesn't work. I haven't changed anything in docker-compose.yml
Please, can you tell me what I missed here?