0

Not sure where to start. I'm moving my wordpress/nginx from server 1 to server 2. Config was almost identical except the server 2 which is the new server using the latest PHP(8.2), php-fpm 8.2 and Nginx 1.14.1, Rocky 8. Server 1 was PHP7.4 PHP-fpm 7.4 Nginx and Centos 7. Nginx starts with no issue but then I'm getting hit with this error.

2022/10/01 22:11:04 [error] 154299#0: *6 connect() to unix:/run/php-fpm/phpfm.sock failed (111: Connection refused) while connecting to upstream, client: Ip Address, server: subdomain.myserver.net, request: "GET /myinfo.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/phpfm.sock:", host: "subdomain.myserver.net"

My Config file.

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;


events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    include /etc/nginx/conf.d/*.conf;

#subdomain
    server {
        server_name  subdomain.myserver.net;
        root         /var/www/wp;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        proxy_connect_timeout 3600s;
        proxy_send_timeout   3600s;
        proxy_read_timeout   3600s;
        proxy_buffer_size    64k;
        proxy_buffers     16 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;
        proxy_pass_header Set-Cookie;
        proxy_redirect     off;
        proxy_hide_header  Vary;
        proxy_set_header   Accept-Encoding '';
        proxy_ignore_headers Cache-Control Expires;
        proxy_set_header   Referer $http_referer;
        proxy_set_header   Host   $host;
        proxy_set_header   Cookie $http_cookie;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        }

        location ~ \.php$       {
        fastcgi_pass   unix:/run/php-fpm/phpfm.sock;
#       fastcgi_pass   127.0.0.1:9000;
        fastcgi_read_timeout 3600;
           fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;

        fastcgi_buffers 16 16k; 
        fastcgi_buffer_size 32k;
        try_files   $uri $uri/ /index.php?$query_string;
                            }
            index  index.php;
            error_page  404              /404.html;
            error_page   500 502 503 504  /50x.html;
            location = /50x.html    {

                            }
 
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/subdomain.myserver.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/subdomain.myserver.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

} 

        upstream php-fpm        {
            server unix:/run/php-fpm/phpfm.sock;
                        }
    server {
    if ($host = subdomain.myserver.net) {
        return 301 https://$host$request_uri;
    } 

        listen  80;
        server_name  subdomain.myserver.net;
    return 404;


}
    }

I changed the domain and IP address for privacy reasons. TBH, I'm not quite sure where to go from there. I think I've tried all the possible solutions I can search on the net and none of them is giving me any hope. Please help?

Le Dude
  • 185
  • 10

0 Answers0