[GH-ISSUE #1371] Error when restore from backup #3864

Closed
opened 2026-02-28 11:58:04 +03:00 by kerem · 8 comments
Owner

Originally created by @khoazero123 on GitHub (Oct 4, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1371

Describe the bug

When I restore from a backup, after logging back in and going to the "Sites List" page, there is an error:

nginx: [crit] pread() "/etc/nginx/modules-enabled/50-mod-http-image-filter.conf" failed (21: Is a directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
exit status 1

To Reproduce
Steps to reproduce the behavior:

  1. Go to nginx-ui webui
  2. Click on Backup -> Backup -> Create Backup. Then I download the backup file and copied the security token.
  3. Create new nginx-ui instance then choose "Restore from Backup" -> upload the backup file and paste security token.
  4. Login to new nginx-ui instance
  5. Go to Manage Sites/Sites List -> Error

Expected behavior
No error. All file in folder /etc/nginx/modules-enabled/ should be file, not directory.

Image

Screenshots
If applicable, add screenshots to help explain your problem.

Info (please complete the following information):

  • Server OS: Ubuntu 22.04
  • Server Arch: x86
  • Nginx UI Version: 2.1.17
  • Your Browser: Chrome

Additional context
Add any other context about the problem here.

Originally created by @khoazero123 on GitHub (Oct 4, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1371 **Describe the bug** When I restore from a backup, after logging back in and going to the "Sites List" page, there is an error: ``` nginx: [crit] pread() "/etc/nginx/modules-enabled/50-mod-http-image-filter.conf" failed (21: Is a directory) nginx: configuration file /etc/nginx/nginx.conf test failed exit status 1 ``` **To Reproduce** Steps to reproduce the behavior: 1. Go to nginx-ui webui 2. Click on Backup -> Backup -> Create Backup. Then I download the backup file and copied the security token. 3. Create new nginx-ui instance then choose "Restore from Backup" -> upload the backup file and paste security token. 4. Login to new nginx-ui instance 5. Go to Manage Sites/Sites List -> Error **Expected behavior** No error. All file in folder `/etc/nginx/modules-enabled/` should be file, not directory. <img width="1678" height="820" alt="Image" src="https://github.com/user-attachments/assets/4bb4f6c5-94fd-43d4-9682-4b6be39a8457" /> **Screenshots** If applicable, add screenshots to help explain your problem. **Info (please complete the following information):** - Server OS: Ubuntu 22.04 - Server Arch: x86 - Nginx UI Version: 2.1.17 - Your Browser: Chrome **Additional context** Add any other context about the problem here.
kerem 2026-02-28 11:58:04 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Oct 4, 2025):

Please provide the output of "ls -la /etc/nginx/modules-enabled/" from the old machine and the same command from the new machine.

<!-- gh-comment-id:3367851610 --> @0xJacky commented on GitHub (Oct 4, 2025): Please provide the output of "ls -la /etc/nginx/modules-enabled/" from the old machine and the same command from the new machine.
Author
Owner

@khoazero123 commented on GitHub (Oct 4, 2025):

Here is output on old machine:

root@nginx-proxy-vm:~# ls -la /etc/nginx/modules-enabled/
total 16
drwxr-xr-x  2 root root 4096 May 17 18:48 .
drwxr-xr-x 11 root root 4096 May 19 22:12 ..
lrwxrwxrwx  1 root root   61 May 17 18:48 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf
lrwxrwxrwx  1 root root   60 May 17 18:48 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf
lrwxrwxrwx  1 root root   48 May 17 18:48 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf
lrwxrwxrwx  1 root root   50 May 17 18:48 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf

Here is output on new machine:

root@c68793213575:/# ls -la /etc/nginx/modules-enabled/
total 24
drwxr-xr-x  6 root root 4096 Oct  4 10:49 .
drwxr-xr-x 11 root root 4096 Oct  4 10:49 ..
drwxr-xr-x  2 root root 4096 Oct  4 10:49 50-mod-http-image-filter.conf
drwxr-xr-x  2 root root 4096 Oct  4 10:49 50-mod-http-xslt-filter.conf
drwxr-xr-x  2 root root 4096 Oct  4 10:49 50-mod-mail.conf
drwxr-xr-x  2 root root 4096 Oct  4 10:49 50-mod-stream.conf
<!-- gh-comment-id:3367854756 --> @khoazero123 commented on GitHub (Oct 4, 2025): Here is output on old machine: ``` root@nginx-proxy-vm:~# ls -la /etc/nginx/modules-enabled/ total 16 drwxr-xr-x 2 root root 4096 May 17 18:48 . drwxr-xr-x 11 root root 4096 May 19 22:12 .. lrwxrwxrwx 1 root root 61 May 17 18:48 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf lrwxrwxrwx 1 root root 60 May 17 18:48 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf lrwxrwxrwx 1 root root 48 May 17 18:48 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf lrwxrwxrwx 1 root root 50 May 17 18:48 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf ``` Here is output on new machine: ``` root@c68793213575:/# ls -la /etc/nginx/modules-enabled/ total 24 drwxr-xr-x 6 root root 4096 Oct 4 10:49 . drwxr-xr-x 11 root root 4096 Oct 4 10:49 .. drwxr-xr-x 2 root root 4096 Oct 4 10:49 50-mod-http-image-filter.conf drwxr-xr-x 2 root root 4096 Oct 4 10:49 50-mod-http-xslt-filter.conf drwxr-xr-x 2 root root 4096 Oct 4 10:49 50-mod-mail.conf drwxr-xr-x 2 root root 4096 Oct 4 10:49 50-mod-stream.conf ```
Author
Owner

@0xJacky commented on GitHub (Oct 4, 2025):

Does the file /usr/share/nginx/modules-available/mod-http-image-filter.conf exist on the new machine?

<!-- gh-comment-id:3367855358 --> @0xJacky commented on GitHub (Oct 4, 2025): Does the file /usr/share/nginx/modules-available/mod-http-image-filter.conf exist on the new machine?
Author
Owner

@khoazero123 commented on GitHub (Oct 4, 2025):

Does the file /usr/share/nginx/modules-available/mod-http-image-filter.conf exist on the new machine?

Yes mate, They are exists before I restore. After I restore from backup, those files became folders

<!-- gh-comment-id:3367858085 --> @khoazero123 commented on GitHub (Oct 4, 2025): > Does the file /usr/share/nginx/modules-available/mod-http-image-filter.conf exist on the new machine? Yes mate, They are exists before I restore. After I restore from backup, those files became folders
Author
Owner

@0xJacky commented on GitHub (Oct 4, 2025):

Could you please provide the output of "nginx -V" on the new machine?

<!-- gh-comment-id:3367914577 --> @0xJacky commented on GitHub (Oct 4, 2025): Could you please provide the output of "nginx -V" on the new machine?
Author
Owner

@khoazero123 commented on GitHub (Oct 4, 2025):

Both are use same version

nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-V1WJUN/nginx-1.18.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-compat --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module
<!-- gh-comment-id:3367980323 --> @khoazero123 commented on GitHub (Oct 4, 2025): Both are use same version ``` nginx version: nginx/1.18.0 (Ubuntu) built with OpenSSL 1.1.1f 31 Mar 2020 TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-V1WJUN/nginx-1.18.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-compat --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module ```
Author
Owner

@0xJacky commented on GitHub (Oct 4, 2025):

The issue is due to the security mechanism limitations of the Nginx UI backup and restore function. Since the new module-path is /usr/lib/nginx/modules, and the symbolic link attempts to link to the files in /usr/share/nginx/modules-available, it was reverted to creating a folder. It seems that the security mechanism has been correctly activated, but the creation of the folder was unexpected. I should fix this and change the setting so that no folder is created in this situation.

<!-- gh-comment-id:3367984369 --> @0xJacky commented on GitHub (Oct 4, 2025): The issue is due to the security mechanism limitations of the Nginx UI backup and restore function. Since the new module-path is /usr/lib/nginx/modules, and the symbolic link attempts to link to the files in /usr/share/nginx/modules-available, it was reverted to creating a folder. It seems that the security mechanism has been correctly activated, but the creation of the folder was unexpected. I should fix this and change the setting so that no folder is created in this situation.
Author
Owner

@khoazero123 commented on GitHub (Oct 4, 2025):

Ok mate.

<!-- gh-comment-id:3367987518 --> @khoazero123 commented on GitHub (Oct 4, 2025): Ok mate.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#3864
No description provided.