Ошибка в почтовом сервере NginX: «Отказано в соединении при чтении заголовка ответа из восходящего потока» - PullRequest
0 голосов
/ 18 марта 2019

Я пытаюсь создать почтовый сервер с postfixadmin, Rspamd и Roundcube. Я уже установил все необходимые Postfix, Dovecot в Nginx и php 7.2, но при отправке почты регистрируется эта ошибка:

2019/03/18 08:24:54 [error] 3140#3140: *5203 FastCGI sent in stderr: "PHP message: fsockopen failed - errno: 111 - errstr: Connection refused" while reading response header from upstream, client: ***.***.***.212, server: mail.miwebsite.com, request: "POST /sendmail.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "mail.miwebsite.com", referrer: "https://mail.miwebsite.com/sendmail.php

это на моем сайте.conf:

server {

    listen 443 ssl http2; # managed by Certbot
    server_name mail.miwebsite.com;
    root /var/www/postfixadmin;

    ssl_certificate /etc/letsencrypt/live/miwebsite.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/miwebsite.com-0001/privkey.pem; # managed by Certbot
    ssl_trusted_certificate /etc/letsencrypt/live/miwebsite.com-0001/chain.pem;
    # include snippets/ssl.conf;
    include snippets/letsencrypt.conf;

    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    error_log /var/www/postfixadmin/logs/error.log;

    location ~ \.php$ {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            if (!-f $document_root$fastcgi_script_name) {return 404;}
            fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
            #fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include snippets/fastcgi-php.conf;
    }
    location / {
            try_files $uri $uri/ /index.php;
    }

    location /postfixadmin {
            index index.php;
            try_files $uri $uri/ /index.php;
    }

    location /rspamd {
            proxy_pass http://127.0.0.1:11334/;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /roundcubemail {
            index index.php;
            try_files $uri $uri/ /roundcubemail/index.php;
    }
    location ~ ^/roundcubemail/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
            deny all;
    }
    location ~ ^/roundcubemail/(bin|SQL|config|temp|logs)/ {
            deny all;
    }
}
...