Nginx doesn't listen the VHOST_PORT

mrios
Participant IV

We have a multi-node setup and we are noticing that once the Routers and Message Processors are created, in the same node, Nginx is not listening on the VHOST_PORT that we specified.

We found a workaround from this post, where we are removing the files from /opt/nginx/conf.d/* and restarting the router. Though, we have to restart it twice in order to regenerate the files and then Nginx will listen to the right port.

We are using OPDK 4.17.05

Is this a known issue? is there a more elegant solution?

Solved Solved
1 6 1,027
1 ACCEPTED SOLUTION

There may be many reasons why nginx doesn't listen (need more details), but a restart of router should fix it. The proper sequence is: stop router; rm -f conf.d/* ; start router. Simple restart of router should've worked but there is a known bug which is being fixed for next OPDK release. For now, please follow the stop|delete|start sequence.

View solution in original post

6 REPLIES 6

Not applicable

I've been working with Matias trying to troubleshoot this.

To add some more detail, the edge-router's configtest of nginx files fails with errors like:

2017-07-11 16:33:37,049  main ERROR UTILS - NetworkUtil.printLog() : nginx: [emerg] zero size shared memory zone "perclient"

or

nginx: [emerg] unknown log format "router" in /opt/nginx/conf.d/MYORG_prod_default.conf.bad:9

The problem seems to be that Apigee isn't placing the "0-default.conf" file in /opt/nginx/conf.d. That file defines some essential nginx configurations.

Our "fix" is deleting /opt/nginx/conf.d/* and restarting the edge-router a couple times. We want to know why this might be happening so we don't have to resort to these crude workarounds.

We have to perform this workaround on each router host.

This is on a fresh install of 4.17.05 with a single organization and no other configuration. We can reproduce this easily.

Not applicable

Can anyone help here? Is there any more info we can provide to help?

mrios
Participant IV
@Maruti Chand
Any advice about this issue?

@Matias bad files are seen if there are any cert issues.
The configtest response here is not helpful, can you check the nginx debug logs?

You can follow the steps here https://community.apigee.com/articles/39653/how-to-enable-debug-log-on-nginx-routers-useful-fo.html

There may be many reasons why nginx doesn't listen (need more details), but a restart of router should fix it. The proper sequence is: stop router; rm -f conf.d/* ; start router. Simple restart of router should've worked but there is a known bug which is being fixed for next OPDK release. For now, please follow the stop|delete|start sequence.

Okay, those steps worked for us.

$ /opt/apigee/apigee-service/bin/apigee-service edge-router stop
$ sudo rm /opt/nginx/conf.d/*
$ /opt/apigee/apigee-service/bin/apigee-service edge-router restart

and then you have to wait at least 5 seconds for the files to show up.