[emerg] open() "/etc/nginx/nginx.conf" failed (13: Permission denied) after configuration restore
0 reputation · 08 Feb 2021, 06:49 UTC
After restoring an nginx configuration from a backup, the goal is to have the service start successfully and serve content using the restored files.
The restored files must retain the original ownership (root:root) and permissions (644 for files, 755 for directories), and any SELinux contexts must match the original policy; otherwise the nginx worker process fails to open nginx.conf with a "[emerg] open() \"/etc/nginx/nginx.conf\" failed (13: Permission denied)" error even though the syntax is correct. nginx does not automatically detect that files have been replaced; an explicit reload or restart is required, and a failed reload can leave the old master process running while workers exit, which may mask partial restoration problems.
- What behavior does nginx exhibit regarding automatic detection of restored configuration files?
- How can administrators verify that a reload after restoration has fully applied the restored configuration without leaving stale master processes?
- Are there any conditions under which a permission‑denied error persists despite correct file ownership and permissions?