• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config'

Abdelkarim Mateos

New Pleskian
After some test with nginx I've several problems.

I tried plesk repair all -v for repair problems, uninstall nginx package, and reinstall and not work.

Code:
[2019-05-19 21:18:31.637] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-l' '/var/www/vhosts/system/phonecomponente.com/conf/nginx_ip_default.conf:/etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf'] with exit code [100]
[2019-05-19 21:18:31.906] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-19 21:18:32.607] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-l' '/var/www/vhosts/system/phonecomponente.com/conf/nginx_ip_default.conf:/etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf'] with exit code [100]
[2019-05-19 21:18:32.993] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-19 21:18:33.236] ERR [panel] Apache config (15582935110.18068800) generation failed: Template_Exception: Destination directory '/etc/nginx/plesk.conf.d/ip_default' not exist

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Destination directory '/etc/nginx/plesk.conf.d/ip_default' not exist
 
> Destination directory '/etc/nginx/plesk.conf.d/ip_default' not exist

Have you tried creating the directory and then doing a repair all once more?
 
Agree with @MarkM

Please try to create this directory with

Code:
#mkdir /etc/nginx/plesk.conf.d/ip_default

Also
Code:
#/usr/local/psa/admin/bin/nginxmng -d
#/usr/local/psa/admin/bin/nginxmng -e

Then try,

Code:
#plesk repair web
 
Well

Steps.

mkdir /etc/nginx/plesk.conf.d/ip_default
Unique warning
Code:
plesk repair web -v
Checking for custom configuration templates
  Custom template
  /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
  has been found
  Some custom configuration templates have been found. The custom
  templates have higher priority than default templates in case of
  configs generation
  Please check documentation for details:
  https://docs.plesk.com/current/redirect.html?book=advanced-administration-guide-linux&page=68693.htm
................................................................... [WARNING]



Code:
/usr/local/psa/admin/sbin/nginxmng --enable
[2019-05-20 12:32:19.796] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 12:32:20.569] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 12:32:20.770] ERR [panel] Apache config (15583483390.28810100) generation failed: Template_Exception: nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed

I think best way restore file sof site from backups.

IMHO
 
Have you add NGINX Custom Code via Plesk Panel for any of these domains?

If you have, Remove them,

Then
Code:
#/usr/local/psa/admin/bin/nginxmng -d
#/usr/local/psa/admin/bin/nginxmng -e

Code:
#plesk repair web
 
Last edited:
Try to rename the custom template for now and retry the commands,

Code:
#mv /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/default/domain/_nginxDomainVirtualHost.php
 
Not work.

Code:
[root@kvm492 ~]# mv /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/default/domain/_nginxDomainVirtualHost.php
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -d
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -e
[2019-05-20 14:20:33.010] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 14:20:33.778] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 14:20:34.056] ERR [panel] Apache config (15583548320.46449900) generation failed: Template_Exception: nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed

Best regards
 
Please remove this file

Code:
#rm /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf

Then,
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -d
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -e
 
Not work...

Code:
[root@kvm492 ~]# rm /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf
rm: ¿borrar el enlace simbólico «/etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf»? (s/n) s
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -d
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -e
[2019-05-20 14:28:51.127] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 14:28:52.020] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
[2019-05-20 14:28:52.361] ERR [panel] Apache config (15583553300.60709200) generation failed: Template_Exception: nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
nginx: [emerg] open() "/etc/nginx/conf.d/expires.global" failed (2: No such file or directory) in /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf:134
nginx: configuration file /etc/nginx/nginx.conf test failed
 
Please post the content of /etc/nginx/plesk.conf.d/ip_default/phonecomponente.com.conf

I'm not sure how did it regenerated. It is looking for this file /etc/nginx/conf.d/expires.global and nginx test fails.
 
Are you sure there is no Custom Detectives in phonecomponente.com in Plesk configuration?

also you can try to create the missing file (empty)

#touch /etc/nginx/conf.d/expires.global

have to tried to,

/usr/local/psa/admin/bin/httpdmng --reconfigure-all
 
Oh.... Now work. After

Almost work

Code:
[
root@kvm492 ~]# touch /etc/nginx/conf.d/expires.global && chown root:nginx /etc/nginx/conf.d/expires.global
root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -d
[root@kvm492 ~]# /usr/local/psa/admin/bin/nginxmng -e

But not work how reverse proxy and get 404 error on prestashop pages. Try a info.php y root site, and work.

Code:
$_SERVER['SERVER_SOFTWARE']    nginx/1.14.2

On logs I see

Code:
2019/05/20 17:27:37 [error] 22103#0: *3 "/var/www/vhosts/phonecomponente.com/httpdocs/es/index.html" is not found (2: No such file or directory), client: 2.137.128.33, server: phonecomponente.com, request: "GET /es/ HTTP/2.0", host: "phonecomponente.com"

On conf I see

Code:
cat /var/www/vhosts/system/phonecomponente.com/conf/nginx_ip_default.conf
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
    listen 5.135.93.76:443 default_server ssl http2;

    server_name phonecomponente.com;
    server_name www.phonecomponente.com;
    server_name ipv4.phonecomponente.com;
    server_name phonecomponentes.com;
    server_name www.phonecomponentes.com;
    server_name phonecomponente.es;
    server_name www.phonecomponente.es;
    server_name phonecomponentes.es;
    server_name www.phonecomponentes.es;

    ssl_certificate             /usr/local/psa/var/certificates/scfKQiWWW;
    ssl_certificate_key         /usr/local/psa/var/certificates/scfKQWWWW;
    ssl_client_certificate      /usr/local/psa/var/certificates/scfmvWWW;

    client_max_body_size 128m;

    proxy_read_timeout 400;

    root "/var/www/vhosts/phonecomponente.com/httpdocs";
    access_log "/var/www/vhosts/system/phonecomponente.com/logs/proxy_access_ssl_log";
    error_log "/var/www/vhosts/system/phonecomponente.com/logs/proxy_error_log";

    location ^~ /plesk-site-preview/ {
        proxy_pass http://127.0.0.1:8880;
        proxy_set_header Host             plesk-site-preview.local;
        proxy_set_header X-Real-IP        $remote_addr;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_cookie_domain plesk-site-preview.local $host;
        access_log off;
    }

    if ($host ~* ^phonecomponentes\.com$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponentes\.com$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^phonecomponente\.es$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponente\.es$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^phonecomponentes\.es$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponentes\.es$) {
        rewrite ^(.*)$ https://phonecomponente.com$1 permanent;
    }

    #extension letsencrypt begin
    location /.well-known/acme-challenge/ {
        root /var/www/vhosts/default/htdocs;

        types { }
        default_type text/plain;

        satisfy any;
        auth_basic off;
        allow all;

        location ~ ^/\.well-known/acme-challenge.*/\. {
            deny all;
        }
    }
    #extension letsencrypt end

    location / {
        proxy_pass https://5.135.93.76:7081;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location /internal-nginx-static-location/ {
        alias /var/www/vhosts/phonecomponente.com/httpdocs/;
        internal;
    }

    location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
        proxy_pass https://5.135.93.76:7081;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
        alias /var/www/vhosts/phonecomponente.com/web_users/$1/$2;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/phonecomponente.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ ^/~(.+?)(/.*)?$ {
        proxy_pass https://5.135.93.76:7081;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location ~ \.php(/.*)?$ {
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/phonecomponente.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ /$ {
        index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
    }

    add_header X-Powered-By PleskLin;

    include /etc/nginx/conf.d/expires.global;

}

server {
    listen 5.135.93.76:80 default_server;

    server_name phonecomponente.com;
    server_name www.phonecomponente.com;
    server_name ipv4.phonecomponente.com;
    server_name phonecomponentes.com;
    server_name www.phonecomponentes.com;
    server_name phonecomponente.es;
    server_name www.phonecomponente.es;
    server_name phonecomponentes.es;
    server_name www.phonecomponentes.es;

    client_max_body_size 128m;

    proxy_read_timeout 400;

    root "/var/www/vhosts/phonecomponente.com/httpdocs";
    access_log "/var/www/vhosts/system/phonecomponente.com/logs/proxy_access_log";
    error_log "/var/www/vhosts/system/phonecomponente.com/logs/proxy_error_log";

    location ^~ /plesk-site-preview/ {
        proxy_pass http://127.0.0.1:8880;
        proxy_set_header Host             plesk-site-preview.local;
        proxy_set_header X-Real-IP        $remote_addr;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_cookie_domain plesk-site-preview.local $host;
        access_log off;
    }

    if ($host ~* ^phonecomponentes\.com$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponentes\.com$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^phonecomponente\.es$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponente\.es$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^phonecomponentes\.es$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }
    if ($host ~* ^www\.phonecomponentes\.es$) {
        rewrite ^(.*)$ http://phonecomponente.com$1 permanent;
    }

    #extension letsencrypt begin
    location /.well-known/acme-challenge/ {
        root /var/www/vhosts/default/htdocs;

        types { }
        default_type text/plain;

        satisfy any;
        auth_basic off;
        allow all;

        location ~ ^/\.well-known/acme-challenge.*/\. {
            deny all;
        }
    }
    #extension letsencrypt end

    location / {
        proxy_pass http://5.135.93.76:7080;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location /internal-nginx-static-location/ {
        alias /var/www/vhosts/phonecomponente.com/httpdocs/;
        internal;
    }

    location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
        proxy_pass http://5.135.93.76:7080;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
        alias /var/www/vhosts/phonecomponente.com/web_users/$1/$2;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/phonecomponente.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ ^/~(.+?)(/.*)?$ {
        proxy_pass http://5.135.93.76:7080;
        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-Accel-Internal /internal-nginx-static-location;
        access_log off;

    }

    location ~ \.php(/.*)?$ {
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/phonecomponente.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ /$ {
        index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
    }

    add_header X-Powered-By PleskLin;

    include /etc/nginx/conf.d/expires.global;

}


Desesperate (And thank you very much for helping me in this nightmare. 20 years with cpanel, virtualmin and ISPConfig, and I never suffered so much for such a simple thing)
 
Is this resolved?

Its looking for index.html you can have change the config to look for index.php

Code:
2019/05/20 17:27:37 [error] 22103#0: *3 "/var/www/vhosts/phonecomponente.com/httpdocs/es/index.html" is not found (2: No such file or directory), client: 2.137.128.33, server: phonecomponente.com, request: "GET /es/ HTTP/2.0", host: "phonecomponente.com"
 
Back
Top