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

nginx-upstream-fair-master - cannot create objs #36

Open
netmart01 opened this issue Apr 24, 2023 · 2 comments
Open

nginx-upstream-fair-master - cannot create objs #36

netmart01 opened this issue Apr 24, 2023 · 2 comments

Comments

@netmart01
Copy link

Hello,
I am looking for some help.
I tried to compile the balance fair module and receive the following error when run “make”

./configure --add-module=/usr/local/nginx/modules/nginx-upstream-fair-master

make
Assembler messages:
Fatal error: can't create objs/addon/nginx-upstream-fair-master/ngx_http_upstream_fair_module.o: Permission denied
/usr/local/nginx/modules/nginx-upstream-fair-master/ngx_http_upstream_fair_module.c: In function ângx_http_upstream_init_fair_rrâ:
/usr/local/nginx/modules/nginx-upstream-fair-master/ngx_http_upstream_fair_module.c:543:28: error: ângx_http_upstream_srv_conf_tâ has no member named âdefault_portâ
if (us->port == 0 && us->default_port == 0) {
^
/usr/local/nginx/modules/nginx-upstream-fair-master/ngx_http_upstream_fair_module.c:553:51: error: ângx_http_upstream_srv_conf_tâ has no member named âdefault_portâ
u.port = (in_port_t) (us->port ? us->port : us->default_port);
^
make[1]: *** [objs/addon/nginx-upstream-fair-master/ngx_http_upstream_fair_module.o] Error 2
make[1]: Leaving directory `/home/ece700/build/nginx-1.23.4'
make: *** [build] Error 2

I would appreciate any help and advice.

Thanks,
Martin

@netmart01
Copy link
Author

In my understanding, when compiling the code it does indicate and issue at line 543 and 553:

if (us->port == 0 && us->default_port == 0) {
    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                  "no port in upstream \"%V\" in %s:%ui",
                  &us->host, us->file_name, us->line);
    return NGX_ERROR;
}

ngx_memzero(&u, sizeof(ngx_url_t));

u.host = us->host;
u.port = (in_port_t) (us->port ? us->port : us->default_port);

==> ngx_http_upstream_srv_conf has no member named default_port

I saw some similar issues at
(openresty/memc-nginx-module#26)
I am running: nginx/1.23.4

@Mozcy
Copy link

Mozcy commented May 22, 2023

Hello, I offer two solutions:

  • The first method: In the src/http/ngx_http_upstream.h file in nginx, add “in_port_t default_port;” under struct ngx_http_upstream_srv_conf_s。
    `R5 30@MHEJY@DP0AUXHUD

  • Method 2: Modify "default_port" in the "ngx_http_upstream_fair_module.c" code to "port"。
    0JG%Q~%Y4TJWY B@ 6(Z00E

Both solutions can be compiled, but there may be some other problems, I am still testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants