Setting up multiple Concrete sites on Nginx

A client is trying to set up 2 Concrete (v8) sites on Nginx running on Azure. They cannot get both to run at the same time. I have no previous experience setting up Nginx servers, so I’m after some hints/advice from anyone who regularly uses Nginx…

  • Both site have been running fine with no errors on Apache, so we know they can run correctly with no errors.
  • They have both sites installed, and both will run individually (i.e. when the other is not configured to run), but, when both are configured to run, neither work.
  • No usable errors are being logged to the server that we can see, and Concrete itself isn’t loading, so we cannot see the Concrete debug page.
  • If we try static html / php files in both, they run fine at the same time, it is just when we run Concrete that things break.
  • When we try to view the sites, nothing loads, we just get a timeout message in the browser.

An example of the config file being used:


server {
        listen 80;
        server_name domain.com;
        return 301 https://$host$request_uri;
}

server {
        listen 443 ssl;
        server_name domain.com;

        ssl_certificate /etc/ssl/domain/_domain.com.crt;
        ssl_certificate_key /etc/ssl/domain/domain_nopass.key;

        root /var/www/html/domain.com;
        index index.php;

        location ~ \.php$ {
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
          fastcgi_index index.php;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_intercept_errors off;
          fastcgi_buffer_size 16k;
          fastcgi_buffers 4 16k;
          fastcgi_connect_timeout 600;
          fastcgi_send_timeout 600;
          fastcgi_read_timeout 600;
        }

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

So - how best to set up Nginx to run multiple sites? Is there something missing from the config above, or any other general things we need to have setup to achieve this.

Annoyingly the sites are not public facing at this time, so I can’t provide any URLs - I know this info is a little vague, but if anyone had any pointers/suggestions that would be great.

Thanks.

There are some Nginx configuration explanations here: Configuration Best Practices :: Concrete CMS

9.1.1 It’s recommended to use PHP 8+

@drbiskit does Jess’ response help answer your question?

Thanks very much @jessicadunbar (+ @EvanCooper for the nudge!) - This was useful to see. I am playing pig-in-the-middle on this one as I don’t have access to the server myself unfortunately. The client is still working on it, but it sounds as though they are making some progress. I’ll update this post in due course if we find there is anything of note that others may find useful.

1 Like