Nginx: [emerg] host not found in upstream "app-xxxxx"

Hello,

I have a “nginx” container that crashes when the php-fpm application is not started, this comes from the fact that nginx check host before launching

not being able to choose the order in which the applications are started

I tried to edit my nginx configuration with :

# docker dns ip or ?
resolver ${IP_HOST_RESOLVER};
set $upstream ${PHP_FPM_HOST}:9000;
# nginx will now start if host is not reachable
fastcgi_pass $upstream; 

Have you already solved this problem?

Thanks for your help

Hello @Nicolas_Hernandez ,

It is not yet integrated with the UI, but you can use this api endpoint in order to set dependencies to an application

https://api-doc.qovery.com/#tag/Dependency/operation/createApplicationDependency

With that nginx will be started after your php-fpm

Hello thanks for your answer !

I have one last question with preview environment are the dependencies also duplicated at their creation?

Preview environment also re-create the dependencies between apps, so you are good to go :slight_smile:

Last thing i tried to set dependencies with api but i receive an http code “415 Unsupported Media Type” it’s normal ?

You need to set the header -H ‘Content-type: application/json’

for example with curl

curl -s -X GET -H 'Content-type: application/json' -H 'Authorization: Bearer/Token xxx'  https://api.qovery.com/cloudProvider
1 Like