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

unknown directive "auth_request" in /etc/nginx/conf.d/edgex-default.conf:59 #891

Open
divyashree123456 opened this issue May 17, 2024 · 13 comments

Comments

@divyashree123456
Copy link

divyashree123456 commented May 17, 2024

while running nginx with docker i m facing error nginx: [emerg] unknown directive "auth_request" in /etc/nginx/conf.d/edgex-default.conf:59
while Running edgex napa version using docker
please help me to debug the issue.

@oxpa
Copy link
Collaborator

oxpa commented May 17, 2024

@divyashree123456 please provide dockerfile/compose config you are using.

@divyashree123456
Copy link
Author

Hi @oxpa
please find a attached docker file and compose config
Dockerfile.txt using in riscv machine.

compose config for nginx:

nginx:
    command:
    - /docker-entrypoint.sh
    - nginx
    - -g
    - daemon off;
    container_name: edgex-nginx
    depends_on:
      security-secretstore-setup:
        condition: service_started
    entrypoint:
    - /bin/sh
    - /edgex-init/nginx_wait_install.sh
    environment:
      PROXY_SETUP_HOST: edgex-security-proxy-setup
      STAGEGATE_BOOTSTRAPPER_HOST: edgex-security-bootstrapper
      STAGEGATE_BOOTSTRAPPER_STARTPORT: "54321"
      STAGEGATE_DATABASE_HOST: edgex-redis
      STAGEGATE_DATABASE_PORT: "6379"
      STAGEGATE_DATABASE_READYPORT: "6379"
      STAGEGATE_PROXYSETUP_READYPORT: "54325"
      STAGEGATE_READY_TORUNPORT: "54329"
      STAGEGATE_REGISTRY_HOST: edgex-core-consul
      STAGEGATE_REGISTRY_PORT: "8500"
      STAGEGATE_REGISTRY_READYPORT: "54324"
      STAGEGATE_SECRETSTORESETUP_HOST: edgex-security-secretstore-setup
      STAGEGATE_SECRETSTORESETUP_TOKENS_READYPORT: "54322"
      STAGEGATE_WAITFOR_TIMEOUT: 60s
    hostname: edgex-nginx
    image: nginx:1.25.3-alpine-slim
    networks:
      edgex-network: {}
    ports:
    #- mode: ingress
     - 127.0.0.1:8443:8443/tcp
    read_only: true
    restart: always
    security_opt:
    - no-new-privileges:true
    tmpfs:
    - /etc/nginx/conf.d
    - /var/cache/nginx
    - /var/log/nginx
    - /var/run
    volumes:
    - edgex-init:/edgex-init:ro,z
    - nginx-templates:/etc/nginx/templates
    - nginx-tls:/etc/ssl/nginx

########################################

@oxpa
Copy link
Collaborator

oxpa commented May 17, 2024

Can you run 'nginx -V' in the container that fails to start and post the output here, please?
We build nginx with auth_request module so my main guess is that you are trying to use some other nginx build.
Or maybe the 'auth_request' line has some non-ascii characters in it and you have to retype it to make sure symbols match what nginx expects.

@divyashree123456
Copy link
Author

divyashree123456 commented May 23, 2024

Hi @oxpa ,
I tried running nginx -V in compose file the following was a output:

Screenshot from 2024-05-23 11-08-35

the compose file is :

nginx:
    command:
    - /docker-entrypoint.sh
    - nginx
    - -V
    container_name: edgex-nginx
    depends_on:
      security-secretstore-setup:
        condition: service_started
    entrypoint:
    - /bin/sh
    - /edgex-init/nginx_wait_install.sh
    environment:
      PROXY_SETUP_HOST: edgex-security-proxy-setup
      STAGEGATE_BOOTSTRAPPER_HOST: edgex-security-bootstrapper
      STAGEGATE_BOOTSTRAPPER_STARTPORT: "54321"
      STAGEGATE_DATABASE_HOST: edgex-redis
      STAGEGATE_DATABASE_PORT: "6379"
      STAGEGATE_DATABASE_READYPORT: "6379"
      STAGEGATE_PROXYSETUP_READYPORT: "54325"
      STAGEGATE_READY_TORUNPORT: "54329"
      STAGEGATE_REGISTRY_HOST: edgex-core-consul
      STAGEGATE_REGISTRY_PORT: "8500"
      STAGEGATE_REGISTRY_READYPORT: "54324"
      STAGEGATE_SECRETSTORESETUP_HOST: edgex-security-secretstore-setup
      STAGEGATE_SECRETSTORESETUP_TOKENS_READYPORT: "54322"
      STAGEGATE_WAITFOR_TIMEOUT: 60s
    hostname: edgex-nginx
    image: nginx:1.25.3-alpine-slim
    networks:
      edgex-network: {}
    ports:
    #- mode: ingress
     - 127.0.0.1:8443:8443/tcp
    read_only: true
    restart: always
    security_opt:
    - no-new-privileges:true
    tmpfs:
    - /etc/nginx/conf.d
    - /var/cache/nginx
    - /var/log/nginx
    - /var/run
    volumes:
    - edgex-init:/edgex-init:ro,z
    - nginx-templates:/etc/nginx/templates
    - nginx-tls:/etc/ssl/nginx

And how can we configure auth _request in the nginx. please do suggest me on this
Thanks in advance

@divyashree123456
Copy link
Author

please @oxpa Help me to resolve this issue.

@oxpa
Copy link
Collaborator

oxpa commented Jul 15, 2024

@divyashree123456 judging by the configure arguments - you didn't build auth request module. So you have to rebuilt nginx binary. And it also probably means that the docker image you are using is not from this repo.

@divyashree123456
Copy link
Author

Hi @oxpa ,
I m building nginx for riscv using this repo files as reference.
Thank you for the inputs , i will try to rebuild a nginx binary.

@thresheek
Copy link
Collaborator

Hi @divyashree123456, did the rebuild fix the issue?

@divyashree123456
Copy link
Author

Hi @oxpa , we rebuild nginc with auth request module ,this issue got resloved by this .
But now I m facing issue related to some file as nginx: [emerg] mkdir() "/run/nginx/client_body_temp" failed (2: No such file or directory)
need to add any configurations for this.
Screenshot from 2024-08-20 12-46-48
Please give your inputs for this.
Thanks in advance

@divyashree123456
Copy link
Author

Hi @oxpa please give me any suggestion or a input for this issue .

@oxpa
Copy link
Collaborator

oxpa commented Aug 26, 2024

@divyashree123456 the error message contains all the information. There is nothing I can add to it.

@divyashree123456
Copy link
Author

Hi @oxpa any suggestions to resolve this.
I tried creating this directory and checked but still facing issue nginx: [emerg] mkdir() "/run/nginx/client_body_temp" failed (2: No such file or directory)

@oxpa
Copy link
Collaborator

oxpa commented Aug 27, 2024

@divyashree123456 I don't think this question belongs here: this is definitely not an nginx docker image problem.
And I'd like to keep issues for the repository they belong to, not to any nginx and docker issues in general.
But you can still get proper help with your endeavor in community slack: https://www.f5.com/company/blog/nginx/nginx-wants-you-join-us-on-the-nginxcommunity-slack

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

3 participants