Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default_port was removed in 1.11.6. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ngx_http_upstream_fair_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,11 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)

/* an upstream implicitly defined by proxy_pass, etc. */

#if nginx_version < 1011006
if (us->port == 0 && us->default_port == 0) {
#else
if (us->port == 0) {
#endif
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"no port in upstream \"%V\" in %s:%ui",
&us->host, us->file_name, us->line);
Expand All @@ -550,8 +554,11 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
ngx_memzero(&u, sizeof(ngx_url_t));

u.host = us->host;
#if nginx_version < 1011006
u.port = (in_port_t) (us->port ? us->port : us->default_port);

#else
u.port = (in_port_t) us->port;
#endif
if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
if (u.err) {
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
Expand Down