1

Topic: 502 Bad Gateway owncloud

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: OpenBSD 5.7 AMD64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====

Good afternoon. Please help with this problem . After a clean install iRedmail 0.9.2 OS OpenBSD 5.7 try to add to the configuration nginx owncloud site and get an error when trying to open the connect () to unix: run / php-fpm.socket failed ( 13 : Permission denied) while connecting to upstream, client: 192.168.3.24, server: _, request: "GET / owncloud / HTTP / 1.1", upstream: "fastcgi: // unix: run / php-fpm.socket:", host: "192.168.3.63"

I added here in this section of the file /etc/nginx/conf.d/default.conf

client_max_body_size 10G; # set max upload size
        fastcgi_buffers 64 4K;
        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
        error_page 403 /core/templates/403.php;
        error_page 404 /core/templates/404.php;


        location ~ ^(.+?\.php)(/.*)?$ {
            try_files $1 = 404;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$1;
            fastcgi_param PATH_INFO $2;
            fastcgi_pass   unix:run/php-fpm.sock;
        }

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location / {
            # The following 2 rules are only needed with webfinger
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

            rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
            rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

            rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

            try_files $uri $uri/ index.php;
        }

        # Optional: set long EXPIRES header on static assets
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
            expires 30d;
            # Optional: Don't log access to assets
            access_log off;
        }

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: 502 Bad Gateway owncloud

89102881488 wrote:

            fastcgi_pass   unix:run/php-fpm.sock;

does it work if you use 'unix:run/php-fpm.sock' as socket path?

iRedMail configures php-fpm socket path in /etc/nginx/conf.d/default.conf, you can use 'fastcgi_pass php_workers' directly.

3

Re: 502 Bad Gateway owncloud

ZhangHuangbin wrote:
89102881488 wrote:

            fastcgi_pass   unix:run/php-fpm.sock;

does it work if you use 'unix:run/php-fpm.sock' as socket path?

iRedMail configures php-fpm socket path in /etc/nginx/conf.d/default.conf, you can use 'fastcgi_pass php_workers' directly.

Yes, it works. Replace the string fastcgi_pass unix: run / php-fpm.socket; on fastcgi_pass php_workers;
and it worked . Thank you very much!