502 Bad Gateway Docker ipv4

Modify and comment out the “nginx-passbolt.conf” file:

Modified lines:

 #listen [::]:80;

 fastcgi_pass             10.250.2.89:3000;

modify these lines since I do not have ipv6 on the server

and I can’t enable ipv6 either since the administration is limited

but when I want to enter the front of the application, nginx marks a 502

docker compose:

version: '3.3'
services:
  db:
    image: mariadb:10.3
    restart: unless-stopped
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_DATABASE: "passbolt"
      MYSQL_USER: "passbolt"
      MYSQL_PASSWORD: "P4ssb0lt"
    volumes:
      - ./pass/database_volume:/var/lib/mysql

  passbolt:
    image: passbolt/passbolt:latest-ce
    #Alternatively you can use rootless:
    #image: passbolt/passbolt:latest-ce-non-root
    restart: unless-stopped
    depends_on:
      - db
    environment:
      APP_FULL_BASE_URL: http://10.250.2.89/
      DATASOURCES_DEFAULT_HOST: "db"
      DATASOURCES_DEFAULT_USERNAME: "passbolt"
      DATASOURCES_DEFAULT_PASSWORD: "P4ssb0lt"
      DATASOURCES_DEFAULT_DATABASE: "passbolt"
    volumes:
      - ./pass/gpg_volume:/etc/passbolt/gpg
      - ./pass/jwt_volume:/etc/passbolt/jwt
      - ./nginx:/etc/nginx/sites-enabled/
    command: ["/usr/bin/wait-for.sh", "-t", "0", "db:3306", "--", "/docker-entrypoint.sh"]
    ports:
     - 3000:80
     - 443:443
    #Alternatively for non-root images:
    # - 8080:80
    # - 4443:433

volumes:
  database_volume:
  gpg_volume:
  jwt_volume:

Logs error:

passbolt_1  | 10.72.2.181 - - [12/Dec/2022:17:44:50 +0000] "GET / HTTP/1.1" 502 552 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
passbolt_1  | 192.168.160.1 - - [12/Dec/2022:17:44:50 +0000] "\x01\x01\x00\x01\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x01\x04\x00\x01\x03\xEC\x04\x00\x0C\x00QUERY_STRING\x0E\x03REQUEST_METHODGET\x0C\x00CONTENT_TYPE\x0E\x00CONTENT_LENGTH\x0B" 400 150 "-" "-"
passbolt_1  | 2022/12/12 17:44:50 [error] 159#159: *1 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 10.72.2.181, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://10.250.2.89:3000", host: "10.250.2.89:3000"

Hello @whazaza welcome to the forum :wink:

We need a bit more context on this one, which OS are you on but also since you are writing version 3.3, are you using Docker 17.06.0 or less?

Can you fill this checklist to provide more context?

I have read intro post: About the Installation Issues category
I have read the tutorials, help and searched for similar issues
I provide relevant information about my server (component names and versions, etc.)
I provide a copy of my logs and healthcheck
I describe the steps I have taken to trouble shoot the problem
I describe the steps on how to reproduce the issue

Thanks in advance

OS: Debian 9
Docker version 19.03.15, build 99e3ed8919
docker-compose version 1.26.0
Only: IPV4
Observations: limited internet access as it is a corporate intranet
Logs: Attaching to passbolt_passbolt_1, passbolt_db_1passbolt_1 | wait-for.sh: wa - Pastebin.com
documentation used for installation: Passbolt Help | Docker passbolt installation

When installing for the first time I ran into the following error:

nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

To solve the error according to what you investigate, you must comment the line:

#listen [::]:80;

after that i can access the nginx through the web browser but with a 502 error

:heavy_check_mark: I have read intro post: About the Installation Issues category
:heavy_check_mark: I have read the tutorials, help and searched for similar issues
:heavy_check_mark: I provide relevant information about my server (component names and versions, etc.)
:heavy_check_mark: I provide a copy of my logs and healthcheck
:heavy_check_mark: I describe the steps I have taken to trouble shoot the problem
:heavy_check_mark: I describe the steps on how to reproduce the issue

Try replacing with listen 80; and see if that helps.

this is my current setup and i have 502 error

file:nginx-passbolt.conf (site-enabled)


#  Passbolt.conf - Nginx configuration file to run the Passbolt software.
#

server {

  listen 80;
  #listen [::]:80;

  # Managed by Passbolt
  # server_name

  client_body_buffer_size     100K;
  client_header_buffer_size   1K;
  client_max_body_size        5M;

  client_body_timeout   10;
  client_header_timeout 10;
  keepalive_timeout     5 5;
  send_timeout          10;

  root /usr/share/php/passbolt/webroot;
  index index.php;
  error_log /var/log/nginx/passbolt-error.log info;
  access_log /var/log/nginx/passbolt-access.log;

  # Managed by Passbolt
  # include __PASSBOLT_SSL__

  location / {
    try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
    try_files                $uri =404;
    include                  fastcgi_params;
    fastcgi_pass             10.250.2.89:3000;
    fastcgi_index            index.php;
    fastcgi_intercept_errors on;
    fastcgi_split_path_info  ^(.+\.php)(.+)$;
    fastcgi_param            SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param            SERVER_NAME $http_host;
    fastcgi_param PHP_VALUE  "upload_max_filesize=5M \n post_max_size=5M";
  }

  location ~* \.(jpe?g|woff|woff2|ttf|gif|png|bmp|ico|css|js|ejs|json|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|svg|woff2|avi|mp\d)$ {
    log_not_found on;

    rewrite ^/([^/]+)/([img|css|js|fonts|locales]+)/(.*)$ /$2/$3 break;
    rewrite ^/([^/]+)/favicon.ico$ /favicon.ico break;

    try_files $uri $uri/ /index.php?$args;
  }
}

Can you explain more why the change here? It should not need to be changed. Also if you are not wanting ssl, port 443 does not need to be routed to the container.

after trying to solve the IPV6 problem by commenting out the following line:

#listen [::]:80;

Try to solve the 502 and try what you mention in this post

Could someone help me in our organization? We are looking forward to testing this tool.

I have difficulty to understand why you made all of those changes?
Can you be a little bit more specific about what are your requirements and restrictions?