Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfixadmin + nginx + php-fpm = bad gateway?[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tenspd1370
n00b
n00b


Joined: 14 Dec 2017
Posts: 51

PostPosted: Tue Nov 06, 2018 3:38 am    Post subject: postfixadmin + nginx + php-fpm = bad gateway?[solved] Reply with quote

Hi all -

I am trying to set up postfixadmin. I am using nginx and php-7.2. I have been following this:

https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server/Admin_Support_Systems


I have nginx setup to run virtual servers and have everything installed in:

/var/www/<site>/htdocs/postfixadmin

My config is as follows:

Code:

server {
    if ($host = <site>) {
        return 301 https://$host$request_uri;
    } # managed by Certbot



  listen 80;
  server_name <site>;
  return 301 https://$server_name$request_uri; # enforce https



}

server {

   listen          443 ssl http2;
   server_name     <site>;
   root            /var/www/<site>/htdocs;
   index           index.php;
   charset         utf-8;
   ssl_protocols             TLSv1.2;
   ssl_ciphers               "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:!aNULL:!eNULL:!LOW:!3DES:!MD5$
   ssl_prefer_server_ciphers on;
   ssl_session_cache         shared:SSL:10m;
   ssl_session_timeout       10m;
   ssl_ecdh_curve            secp521r1;

   add_header Strict-Transport-Security max-age=31536000;
   # add_header X-Frame-Options DENY;

   # auth_basic "Restricted area";
   # auth_basic_user_file /etc/nginx/passwd;

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

   location ~* \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include       fastcgi_params;
        fastcgi_pass  unix:/run/php-fpm.socket;
    ssl_certificate /etc/letsencrypt/live/<site>/fullchain.pem; # managed b$
    ssl_certificate_key /etc/letsencrypt/live/<site>/privkey.pem; # managed$
}



/run/php-fpm.socket exists belonging to nginx:nginx with srw-rw---- permissions.

in nginx.conf, I have:
Code:

http{
....
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
          fastcgi_connect_timeout 300;
          fastcgi_send_timeout 300;
          fastcgi_read_timeout 300;
}


The nginx error I keep getting is:
Code:

2018/11/05 20:42:33 [error] 21391#21391: *2 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: <site>, request: "GET /postfixadmin/setup.php HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm.socket:", host: "<site>"


I also set up postgres with a postfixadmin user and postfix db. I am assuming the setup.php configured it from there. I can't figure out what I am missing.

Any help is appreciated!

Thanks!


After I setup the config.inc.php and try to go to https://<site>/postfixadmin/setup.php, I still get Bad Gateway. Any suggestions - is there something I am missing that anyone can see from this?

###########################################
Solution:
include fastcgi_params
should be
include /etc/nginx/fastcgi.conf
in this case
###########################################
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum