# apt remove libnginx-mod-http-perl Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libgeoip1 libhiredis0.14 libluajit-5.1-2 libluajit-5.1-common libnginx-mod-http-auth-pam libnginx-mod-http-cache-purge libnginx-mod-http-dav-ext libnginx-mod-http-echo libnginx-mod-http-fancyindex libnginx-mod-http-geoip libnginx-mod-http-geoip2 libnginx-mod-http-headers-more-filter libnginx-mod-http-lua libnginx-mod-http-ndk libnginx-mod-http-subs-filter libnginx-mod-http-uploadprogress libnginx-mod-http-upstream-fair libnginx-mod-nchan Use 'apt autoremove' to remove them. The following additional packages will be installed: nginx-core Suggested packages: nginx-doc The following packages will be REMOVED: libnginx-mod-http-perl nginx-extras The following NEW packages will be installed: nginx-core 0 upgraded, 1 newly installed, 2 to remove and 2 not upgraded.
Another workaround is just to delete the symbolic link at /etc/nginx/modules-enabled/50-mod-http-perl.conf and restart Nginx. Now, Nginx wont load the Perl module and will reload correctly.
In my case I'm using "nginx-extras" and can't purge the package libnginx-mod-http-perl due to dependencies.