diff --git a/plugins/corerouter/cr_common.c b/plugins/corerouter/cr_common.c index 3d0a4013..7a7709df 100644 --- a/plugins/corerouter/cr_common.c +++ b/plugins/corerouter/cr_common.c @@ -59,6 +59,14 @@ void uwsgi_corerouter_setup_sockets(struct uwsgi_corerouter *ucr) { uwsgi.no_defer_accept = current_defer_accept; } } + // fix SERVER_PORT + if (!ugs->port || !ugs->port_len) { + ugs->port = strchr(ugs->name, ':'); + if (ugs->port) { + ugs->port++; + ugs->port_len = strlen(ugs->port); + } + } // put socket in non-blocking mode uwsgi_socket_nb(ugs->fd); uwsgi_log("%s bound on %s fd %d\n", ucr->name, ugs->name, ugs->fd);