Shared link returns 404 behin Nginx server

Hello, I have a pydio 6.0.8 release installed, all seems to be ok but when I upload and try to share, the shared link returns a 404 error.
I can reach the shared link with the private IP address, but not from the public link :frowning:
I think the problem comes from rewrite rules in my Pydio nginx conf file, but I can’t find what it is.
For information, folders are like this :
pydiomycompanyDOTcom/pydio/ --> goes to website to upload
pydiomycompanyDOTcom/pydio_public/ --> goes to download (with number generated to download)

Here is the Nginx Pydio conf file.
It you have an idea, I would be happy to hear it, I can’t solve it, many thanks for your help to come !


upstream pydio_mycompany{
server 192.168.220.11:80;
}

server {
listen 80;
server_name pydio.mycompany.com;

   if ($scheme != "https") {
           rewrite ^ https://$host$uri permanent;
   }

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

}

server {
listen 443;
listen [::]:443 ssl;
server_name pydio.mycompany.com;
keepalive_timeout 300;

    ssl_certificate /etc/letsencrypt/live/pydio.mycompany.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/pydio.mycompany.com/privkey.pem;


    location /.well-known {
            alias /usr/share/pydio/.well-known;
    }



    location / {
        proxy_pass http://pydio_mycompany;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Proto $scheme;

    }


    location /pydio_public {

        rewrite ^/pydio_public/(.*)$ /$1 break;

    if ( !-e $request_filename ) {
            # WebDAV Rewrites
            rewrite ^/shares /dav.php last;
            # Sync client
            rewrite ^/api /rest.php last;
            # External users
            rewrite ^/user ./index.php?get_action=user_access_point last;
            # Public shares
            rewrite ^/pydio_public/([a-zA-Z0-9_-]+)\.php$ /pydio_public/share.php?hash=$1?;
    }
    rewrite ^/pydio_public/([a-zA-Z0-9_-]+)--([a-z]+)$ /pydio_public/share.php?hash=$1&lang=$2?;
    rewrite ^/pydio_public/([a-zA-Z0-9_-]+)$ /pydio_public/share.php?hash=$1?;


        proxy_pass http://pydio_mycompany/pydio_public;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Proto $scheme;

    }




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

}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.