• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue NGinx permissions denied when download files from PHP

Alexdb

New Pleskian
i have a Plesk: psa v12.5.30_build1205150826.19 os_Ubuntu 14.04

recently i made a big mistake and ran this command: chown -R 10003:1003 /
It set all my permissions to 10003 and myPlesk was broken. I repair it via ssh with plesk repair fs and launched an update of plesk via ssh.

But i have still some issue, when i triggers a download via PHP with this code:
$mm_type="application/octet-stream";
$file = '../uploads/files/' . $filename;
header("Cache-Control: public, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: " . $mm_type);
header("Content-Length: " .filesize($filename));
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary\n");

ob_end_clean();

readfile($file);

my files are the size of 64kb so they should be 17MB. I investigated and found this error in "proxy_error_log':
2019/01/20 18:34:53 [crit] 28055#0: *17137 open() "/var/lib/nginx/proxy/3/10/0000000103" failed (13: Permission denied) while reading upstream, client: 80.XXX.XXX.XXX, server: mydomain.com, request: "GET /download.php?id=15 HTTP/1.1", upstream: "https://45.XXX.XXX.XXX:7081/download.php?id=15", host: "mydomain.com"

This permissions issue reapper, can you tell me whats the good permissions for /var/lib/nginx please? Or tell my how to set the rights permissions.
Thanks
 
drwx------ 7 nginx nginx 4096 Dec 4 13:40 nginx

./nginx:
drwx------ 7 nginx nginx 4096 Dec 4 13:40 .
drwxr-xr-x. 39 root root 4096 Dec 3 18:34 ..
drwx------ 2 nginx root 4096 Jan 20 20:31 body
drwx------ 9 nginx root 4096 Jan 4 16:57 fastcgi
drwx------ 12 nginx root 4096 Dec 7 13:54 proxy
drwx------ 2 nginx root 4096 Dec 2 15:07 scgi
drwx------ 2 nginx root 4096 Dec 2 15:07 uwsgi
 
thanks, that's what i have. But can you show me what you have in body and proxy please?

I think i solved my issue by ran this in body and proxy:
chown -R nginx:root *
because in body and proxy permissions were set to: root:root
 
Back
Top