gcloud app deploy failled

An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2024-09-20T15:24:00.572Z1108.qf.1: nginx: [emerg] “server” directive is not allowed here in /workspace/nginx.conf:1

Hi @sehhroy ,

Welcome to Google Cloud Community!

I noticed that the internal error message you encountered while deploying in App Engine contains a statement:

2024-09-20T15:24:00.572Z1108.qf.1: nginx: [emerg] "server" directive is not allowed here in /workspace/nginx.conf:1.

This means that there’s probably a syntax problem happening in the NGINX configuration file (nginx.conf) which is usually a risk when the file itself is being reconfigured or modified. The “server” directive may be in the wrong place in the NGINX configuration file. Based on a tip from a similar Server Fault topic shared by @Esa Jokinen, and a suggestion from a Stack Overflow topic shared by @Richard Smith, identify any possible syntax issues from the nginx.conf file then address it. Afterwards, try to deploy again.

For additional troubleshooting tips in fixing the nginx “server” directive issue, you can also visit this article. Note though that the reference is from a third party, and not maintained by Google.

I hope the above information is helpful.