Nginx configuration help needed on ubuntu 18.04

Tried looking for a solution for days on the net about installing the latest SuiteCRM on a local machine running Ubuntu 18.04

PHP, Nginx, MariaDB all seems to be install properly. Do not know how to configure nginx to point to a local address. (I need to perform some testing before putting it online).

I want to start configure suitecrm via the browser by open a browser to 192.168.2.227 and got bad gateway error
Tested on 127.0.0.1 nginx is working fine.

Any suggestion on how to set this up on a local machine (i.e., based on a local fixed IP address only)? This machine later will be live and only be accessible via a VPN behind a firewall using a local fixed IP.

$cat /var/log/nginx/suitecrm_error.log
2018/10/10 10:55:06 [error] 1077#1077: *93 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.227, server: 192.168.2.227, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “192.168.2.227”
2018/10/10 10:55:09 [error] 1077#1077: *93 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.227, server: 192.168.2.227, request: “GET /status HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “192.168.2.227”
2018/10/10 10:55:09 [error] 1077#1077: *93 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.227, server: 192.168.2.227, request: “GET /favicon.ico HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “192.168.2.227”, referrer: “http://192.168.2.227/status
2018/10/10 10:55:41 [error] 1077#1077: *93 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.227, server: 192.168.2.227, request: “GET /favicon.ico HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “192.168.2.227”, referrer: “http://192.168.2.227/

$ cat /etc/nginx/conf.d/suitecrm.conf
server {
server_name 192.168.2.227;
client_max_body_size 50M;
root /srv/suitecrm;

location / {
   try_files $uri /index.php;

}
location ~ .php$ {
try_files $uri =404;
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_log /var/log/nginx/suitecrm_error.log;
access_log /var/log/nginx/suitecrm_access.log;
location ~ /.ht {
deny all;
}
}

$sudo service --status-all
[ + ] acpid
[ - ] alsa-utils
[ - ] anacron
[ + ] apparmor
[ + ] apport
[ + ] avahi-daemon
[ + ] binfmt-support
[ - ] bluetooth
[ - ] brltty
[ - ] console-setup.sh
[ + ] cpufrequtils
[ + ] cron
[ + ] cups
[ + ] cups-browsed
[ + ] dbus
[ - ] dns-clean
[ + ] grub-common
[ - ] hwclock.sh
[ + ] irqbalance
[ - ] keyboard-setup.sh
[ + ] kmod
[ + ] lightdm
[ + ] lm-sensors
[ + ] loadcpufreq
[ + ] mysql
[ + ] network-manager
[ + ] networking
[ + ] nginx
[ + ] php7.2-fpm
[ - ] plymouth
[ - ] plymouth-log
[ - ] pppd-dns
[ + ] procps
[ + ] resolvconf
[ - ] rsync
[ + ] rsyslog
[ - ] saned
[ + ] speech-dispatcher
[ + ] thermald
[ + ] udev
[ + ] ufw
[ + ] unattended-upgrades
[ - ] uuidd
[ + ] whoopsie
[ - ] x11-common

Hi,

This forum is mainly for SuiteCRM questions and not basic server configuration, but I’ll try to answer your question.

[ul]
[li]the nginx directive “server_name” is not meant for IP-addresses, you can put a test servername here like

server_name myserver.local;

and then put in

/etc/hosts

the following line:

192.168.2.227                 myserver.local

Afterwards try http://myserver.local in your browser
[/li]
[li]php-fpm either listens on a network port or a unix socket. Default configuration for current linux is a unix socket. Your nginx configuration however expects a network port. To find out the configuration, check php-fpm.conf, you can find it by:

locate php-fpm.conf

The configuration for the listening option will probably be outsourced in a subdirectory where the following file resides:

pool.d/www.conf

Check for a line like this:

listen = /run/php/php7.2-fpm.sock

Adapt your nginx.conf file accordingly
[/li]
[/ul]