Nginx welcome page after migrating to Ubuntu package (20.04.2)

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

Overview:
I just switched our Passbolt installation to an Ubuntu package via the Passbolt documentation here: Passbolt Help | Migrate passbolt CE from install scripts to Ubuntu package

I followed all the steps properly and it migrated my database and everything, but when I go to visit the URL, I just get the nginx welcome page:
image

I looked inside /etc/nginx/conf.d and there are no config files in here for Passbolt - is there supposed to be one in there?

Information
Ubtunu Version: 20.04.2 LTS
Passbolt Version:
PHP Version: 7.4
Nginx Version: 1.18.0

Hello, I have the same issue. It was working fine till last week, and suddenly from yesterday, I see nginx welcome screen. However, it works with SSL https://passbolt.domain.com. Hope that helps.

I’m still having this issue… I’m sure other people are?

Hello @swebervna,

In order to reproduce your error to be able to provide you a solution, here are some questions for you :

  • Did you just migrate passbolt from source to package installation or did you update your OS or passbolt version by the same time ?
  • Which version of passbolt are you using ? You should be able to find it in /etc/passbolt/version.php.
  • Did you try to reload Nginx process after this migration process ?

Cheers.

@Gerold

  • As per the guide provided by Passbolt, I upgraded my OS version first THEN migrated Passbolt over.
  • I can’t provide that as of now cause it’s during office hours and I can’t have Passbolt un-usable during that time. I’m sure it was the latest version available as an Ubuntu package.
  • Yes, I’ve tried that and restarting.

@swebervna
Thanks for these informations.

Could you please provide the content of both files :
/etc/nginx/sites-available/nginx-passbolt.conf
/etc/nginx/sites-available/default

Cheers,
GĂ©rold.

/etc/nginx/sites-available/nginx-passbolt.conf:

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

server {

  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             unix:/run/php/__PHP_VERSION__-fpm.sock;
    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";
  }

}

/etc/nginx/sites-available/default:

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

I’d like to also point out that, when you go through the guide for migrating CE script to package and you reconfigure Passbolt, set Nginx config cert to Auto, it throws an error:
image

This can easily be fixed by running:

sudo apt-get install python3-certbot-nginx

I recommend you guys add this part to the guide, though, because most users probably don’t have that installed (or rather it got removed during the Ubuntu upgrade).

Hello @swebervna,

I followed the documentation to try to reproduce your issue but I don’t get to the same result.

To answer your question, no we don’t expect any configuration of passbolt in /etc/nginx/conf.d.

Could you please make sure that your passbolt site is enabled in NGINX ?

Also, could you please provide us your NGINX logs to see if we get anything relevant that could help us to find a solution ?

Thank you for pointing out the certbot issue, we will consider to improve the documentation with your findings.

Cheers,
GĂ©rold.

There must be something wrong with my installation beforehand, then, if you aren’t getting this issue. However, earlier in this post, somebody else said they ran into the same issue.

Yes, the nginx-passbolt.conf file is in sites-enabled. That means it’s enabled, right? Here’s that conf file:

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

server {

  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             unix:/run/php/php7.4-fpm.sock;
    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";
  }

}

You can view my nginx error logs here: nginx_error_logs_passbolt.zip - Google Drive

The only obvious error I noticed is that the SSL conf file in conf.d is using a wrong syntax, but that must’ve been before I upgraded Ubuntu and migrated Passbolt, because that conf file isn’t there anymore.

ATTENTION: I SOLVED THE ISSUE

What I did was:

  1. Manually edited /etc/nginx/sites-enabled/nginx-passbolt.conf and specified my passbolt domain name in the “server_name” part at the top.
  2. Deleted the “default” site in sites-enabled.
  3. Edited the /etc/nginx/nginx.conf file, removed the default site from the Virtual Host Configs section at the bottom, and added Passbolt by inserting the following:
include /etc/nginx/sites-enabled/*.conf;
  1. Re-ran the server configuration command, set nginx to auto and followed the steps to reconfigure nginx - it configured it correctly and this time it actually inserted the SSL config part into the nginx-passbolt.conf file.
sudo dpkg-reconfigure passbolt-ce-server

And that’s it!

Gerold, I think the migration documentation needs updated to address this issue that may be happening to people (the nginx-passbolt.conf not having a server_name and the nginx.conf file not specifying the passbolt conf in sites-enabled).

1 Like

It seems like your conf is enabled yes, but as I can see in the error.log.1 file, you have some warning from May 27 2021 about the “ssl” directive that is deprecated so I think that you still have the /etc/nginx/conf.d/passbolt_ssl.conf file that would probably take over the new config.

Maybe it would be worth to try to save that file somewhere else, delete it from /etc/nginx/conf.d and to restart NGINX to see if its related to your issue or not.