Nginx 502 Gateway Error on Template Upload

HumanGenome

New Member
Hello! Hopefully this is the right place to post. I am having a hard time with Mailwizz.

I am trying to upload the example-template.zip provided by the default Mailwizz install.
I have my own template and that does not work either.

The problem occurs when -

I upload a template with a ZIP file (regardless of CSS or Minify options toggled)
I try to Save a template with source code > 250 ~ lines (under that it seems to work)

I have checked the error log and this is the error:

2015/05/29 11:58:10 [error] 9962#0: *2892 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 999.999.999.999, server: MYDOMAIN.com, request: "POST /mailwizz/customer/index.php/templates/upload HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "www.MYDOMAIN.com", referrer: "https://www.MYDOMAIN.com/mailwizz/customer/index.php/templates/index"
My setup -

PHP Version 5.4.37
Nginx 1.4.3
Mailwizz 1.3.5.2
Install directory http://www.MYDOMAIN.com/mailwizz/

Nginx config -

Code:
pid /var/run/nginx.pid;
worker_processes 2;
error_log /etc/nginx/logs/error.log debug;
worker_rlimit_nofile 768;

events {
    worker_connections 768;
    use epoll;
    multi_accept on;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    access_log off;
    ignore_invalid_headers     on;
    sendfile        off;
    tcp_nopush     on;
    tcp_nodelay    on;
    server_tokens  off;
    gzip  off;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
  
    server {
        listen       999.999.999.999:80;
        server_name  MYDOMAIN.com www.MYDOMAIN.com;
        error_log    /etc/nginx/logs/MYDOMAIN.com.http.error.log;
        # access_log   /etc/nginx/logs/MYDOMAIN.com.http.access.log;

        # Root data
        root /home/MYDOMAIN.com/public;

        # Error pages
        error_page 404  /404.php;
        error_page 500 502 503  /502.php;
        error_page 504 /504.php;

        client_max_body_size 5M;

        # Favicon Not Found
        location = /favicon.ico {
                access_log off;
                log_not_found off;
        }

        # Robots.txt Not Found
        location = /robots.txt {
                access_log off;
                log_not_found off;
        }

        # Location server
        location /{
                index  index.php home.php index.html index.htm;
                include /etc/nginx/fastcgi.conf;

                # if file exists return it right away
                #try_files $uri $uri/ /index.php;
        }
      
        ## required for mailwizz
        location ~ .*\.(ico|gif|jpg|jpeg|png|js|css) {
        }

        location /mailwizz/ {
            if (!-e $request_filename){
            #rewrite mailwizz/api/.* /mailwizz/api/index.php;
            rewrite ^(/)?mailwizz/api/.*$ /mailwizz/api/index.php;
            }
            if (!-e $request_filename){
            #rewrite mailwizz/customer/.* /mailwizz/customer/index.php;
            rewrite ^(/)?mailwizz/customer/.*$ /mailwizz/customer/index.php;
            }
            if (!-e $request_filename){
            #rewrite mailwizz/backend/.* /mailwizz/backend/index.php;
            rewrite ^(/)?mailwizz/backend/.*$ /mailwizz/backend/index.php;
            }
            if (!-e $request_filename){
            #rewrite ^(.*)$ /mailwizz/index.php;
            rewrite ^(.*)$ /mailwizz/index.php;
            }
            index  index.html index.htm index.php;
        }
        ## required for mailwizz

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
                index  index.php index.html index.htm;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass   unix:/var/run/php-fpm.sock;
                fastcgi_index  index.php;
                #fastcgi_param  APPLICATION_ENV development;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param   PATH_INFO    $path_info;
                fastcgi_read_timeout 1800;
                fastcgi_send_timeout 1800;
          }

        # Deny access to .ht* files
        location ~ /\.(ht|svn) {
            deny all;
        }
    }
}
Please help. I really would like this installed on the same website and not have to purchase new hosting just for Mailwizz.
 

HumanGenome

New Member
I have lots of other applications running on the same server without issue (including file upload / large text processing)

I'll keep looking around.
 

twisted1919

Administrator
Staff member
well, it isn't mailwizz either as it runs on nginx just fine even though it's not officially supported.
 
Top