504 Gateway Time-out When Using PHP-FPM 7.3 and Nginx 1.16.1
I'm having a problem where when I try to access the backend area of Hubzilla, it loads for around a minute and then it returns a 504 Gateway Timeout error every time it tries to load. I've tried reinstalling Hubzilla by dropping the database and deleting the .htconfig.php file. The issue does not go away. During installation, Hubzilla has verified that all of the required modules are installed for it to work. The database also installed correctly according to the installation setup.
I believe this is the error that is causing this problem when I look in the log file:
2020/03/05 14:49:54 [error] 10083#10083: *42930 upstream timed out (110: Connection timed out) while reading response header from upstream, client: *censored*, server: social.go-rs.tk, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/social.go-rs.tk.sock", host: "social.go-rs.tk", referrer: "http://social.go-rs.tk/network"
I am using CentOS 7.7, Nginx 1.16.1, and PHP-FPM with the version set to 7.3. I have also tried switching to version 7.4 with no luck.
This is my Nginx configuration file:
server {
server_name social.go-rs.tk www.social.go-rs.tk ;
listen 192.168.0.5:80;
charset utf-8;
gzip on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/css text/xml application/javascript text/plain application/json image/svg+xml image/x-icon;
gzip_comp_level 1;
set $root_path /var/www/aclevo.xyz/data/www/social.go-rs.tk;
root $root_path;
disable_symlinks if_not_owner from=$root_path;
index index.php index.html index.htm;
client_max_body_size 100M;
location / {
if ($is_args != "") {
rewrite ^/(.*) /index.php?q=$uri&$args last;
}
rewrite ^/(.*) /index.php?q=$uri last;
}
location ^~ /.well-known/ { allow all; rewrite ^/(.*) /index.php?q=$uri&$args last; }
location ~ \.php$ {
fastcgi_pass unix:/var/run/social.go-rs.tk.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico)$ {
try_files $uri $uri/ @fallback;
}
location @fallback {
fastcgi_pass unix:/var/run/social.go-rs.tk.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
include "/etc/nginx/fastpanel2-sites/aclevo.xyz/social.go-rs.tk.includes";
include /etc/nginx/fastpanel2-includes/*.conf;
error_log /var/www/aclevo.xyz/data/logs/social.go-rs.tk-frontend.error.log;
access_log /var/www/aclevo.xyz/data/logs/social.go-rs.tk-frontend.access.log;
}
This is my PHP socket file:
[social.go-rs.tk]
user = aclevo.xyz
group = aclevo.xyz
listen = /var/run/social.go-rs.tk.sock
listen.owner = aclevo.xyz
listen.group = apache
listen.mode = 0660
pm = dynamic
pm.max_children = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 1000
php_admin_value[date.timezone] = "Europe/Moscow"
php_admin_value[display_errors] = "off"
php_admin_value[log_errors] = "On"
php_admin_value[mail.add_x_header] = "On"
php_admin_value[max_execution_time] = "120"
php_admin_value[max_input_vars] = "10000"
php_admin_value[opcache.blacklist_filename] = "/opt/opcache-blacklists/opcache-*.blacklist"
php_admin_value[opcache.max_accelerated_files] = "100000"
php_admin_value[output_buffering] = "4096"
php_admin_value[post_max_size] = "100M"
php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -f 'admin@social.go-rs.tk'"
php_admin_value[session.save_path] = "/var/www/aclevo.xyz/data/tmp"
php_admin_value[short_open_tag] = "On"
php_admin_value[upload_max_filesize] = "100M"
php_admin_value[upload_tmp_dir] = "/var/www/aclevo.xyz/data/tmp"
catch_workers_output = yes
access.format = "%{REMOTE_ADDR}e - [%t] \"%m %r\" %s %{kilo}M \"%{HTTP_USER_AGENT}e\""
access.log = /var/www/aclevo.xyz/data/logs/social.go-rs.tk-backend.access.log