• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved erreur httpdmng

lesny

New Pleskian
hi

i have a problem

[FAILED]
- httpdmng failed: [2017-08-08 11:42:33] ERR [util_exec]
proc_close() failed ['/opt/psa/admin/bin/nginx-config' '-t']
with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-08-08 11:42:35] ERR [util_exec] proc_close() failed
['/opt/psa/admin/bin/nginx-config' '-t'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-08-08 11:42:37] ERR [panel] Apache config
(15021853520.57333700) generation failed: Template_Exception:
nginx: [emerg] "location" directive is not allowed here in
/etc/nginx/nginx.conf:16
nginx: configuration file /etc/nginx/nginx.conf test failed

file:
/opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Error occured while sending feedback. HTTP code returned: 502
nginx: [emerg] "location" directive is not allowed here in
/etc/nginx/nginx.conf:16
nginx: configuration file /etc/nginx/nginx.conf test failed

Update the file of sharing passwords and permissions of users according to actual information? [Y/n] y
Updating the file of sharing passwords and permissions of users
according to actual information ................................. [OK]

Repair web server configuration for all domains? [Y/n] y
Repairing web server configuration for all domains. This aspect
can be used with individual domains ("plesk repair web
example.com"), and on the server level ("plesk repair web") ..... [2017-08-08 11:43:20] ERR [util_exec] proc_clos
[FAILED]
- httpdmng failed: Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-server
[1] => -no-restart
)

Details: [2017-08-08 11:42:54] ERR [util_exec] proc_close()
failed ['/opt/psa/admin/bin/nginx-config' '-t'] with exit code
[1]
Error occured while sending feedback. HTTP code returned: 502
[2017-08-08 11:42:59] ERR [util_exec] proc_close() failed
['/opt/psa/admin/bin/nginx-config' '-t'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-08-08 11:43:00] ERR [panel] Apache config
(15021853740.40136900) generation failed: Template_Exception:
nginx: [emerg] "location" directive is not allowed here in
/etc/nginx/nginx.conf:16
nginx: configuration file /etc/nginx/nginx.conf test failed

file:
/opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Error occured while sending feedback. HTTP code returned: 502
nginx: [emerg] "location" directive is not allowed here in
/etc/nginx/nginx.conf:16
nginx: configuration file /etc/nginx/nginx.conf test failed

thx you for help me
 
nginx: [emerg] "location" directive is not allowed here in
/etc/nginx/nginx.conf:16
Have you added "location" directive in Additional nginx directives for subscription?
What is there in line 16 of /etc/nginx/nginx.conf file?
 
Thanks for your reply here is what I got at line 16

}
location / {
autoindex off;
}


Sorry i have plenty of mistake with plek i think you embort it all day
 
Hi lesny,

pls. REMOVE such "location" - directives from your serverwide "nginx.conf", as these directives have to be setup only INSIDE the "server" directives.
For such settings, you would use the "additional nginx directives" over the Plesk Control Panel. :)


Sorry i have plenty of mistake with plek i think you embort it all day
Pls. feel free to use the FORUM SEARCH ( => Search | Plesk Forum ), before you post the ( possible ) next issue/error/error problem at a new thread ( if it isn't related to this one and it's thread title - which should be translated into ENGLISH, pls. ;) )
 
hi

Thank you for your answer by cons here is my nginx.conf what do I remove?

#user nginx;
worker_processes 1;

#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

#pid /var/run/nginx.pid;

include /etc/nginx/modules.conf.d/*.conf;

events {
worker_connections 1024;
}
location / {
autoindex off;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
#tcp_nodelay on;

#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";

server_tokens off;

include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
 
Hi lesny,

here is my nginx.conf what do I remove?
Ples. remove:
Code:
location / {
autoindex off;
}
... and use the command:
Code:
nginx -t
afterwards, to check your nginx - webserver - configuration.

If all is "o.k.", pls. continue with
Code:
plesk repair all -y -v
 
good thank you

But now I have a new error



Repairing server-wide configuration parameters for web servers .. [2017-08-08 17:20:21] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/httpdmng' '--reconfigure-server'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[FAILED]
- httpdmng failed: [2017-08-08 17:20:19] ERR [util_exec]
proc_close() failed ['/opt/psa/admin/bin/nginx_control'
'--restart'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
Error occured while sending feedback. HTTP code returned: 502
Can not reload proxy server:
Updating the file of sharing passwords and permissions of users
according to actual information ................................. [OK]
Repairing web server configuration for all domains. This aspect
can be used with individual domains ("plesk repair web
example.com"), and on the server level ("plesk repair web") ..... [2017-08-08 17:20:33] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/httpdmng' '--reconfigure-all'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[FAILED]
- httpdmng failed: Error occured while sending feedback. HTTP
code returned: 502
Error occured while sending feedback. HTTP code returned: 502
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] =>
aqua-aulnoy.fr,forumeasy.fr,images.forumeasy.fr,support.forumeasy.fr
)

Details: [2017-08-08 17:20:30] ERR [util_exec] proc_close()
failed ['/opt/psa/admin/bin/nginx_control' '--restart'] with
exit code [1]
Error occured while sending feedback. HTTP code returned: 502
Error occured while sending feedback. HTTP code returned: 502
Can not reload proxy server:
 
Hi lesny,

Can not reload proxy server
Is nginx installed on your server ?

Is nginx running?

What ist the output of the commands:
Code:
nginx -t

/usr/local/psa/admin/bin/nginxmng -s

service nginx restart
 
~# Nginx -t
-bash: Nginx: command not found
:~# /usr/local/psa/admin/bin/nginxmng -s
Enabled
:~# service nginx restart
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
 
Hi lesny,

~# Nginx -t
-bash: Nginx: command not found
Did you at least try to use the correct command:
Code:
nginx -t
N is not n ;)



As you can see within your output, you have the choice to display MORE information by using the commands:
Code:
systemctl status nginx.service
or/and
Code:
journalctl -xn
Pls. consider to use these commands, in order to show MORE details, why the service couldn't be started. :)
 
hi,

systemctl status nginx.service
â nginx.service - Startup script for nginx service
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Tue 2017-08-08 17:54:59 CEST; 8min ago
Process: 3711 ExecStartPre=/usr/bin/test $NGINX_ENABLED = yes (code=exited, status=1/FAILURE)

Aug 08 17:54:59 forumeasy.fr systemd[1]: nginx.service: control process exited, code=exited status=1
Aug 08 17:54:59 forumeasy.fr systemd[1]: Failed to start Startup script for nginx service.
Aug 08 17:54:59 forumeasy.fr systemd[1]: Unit nginx.service entered failed state.
****@****:~# journalctl -xn
-- Logs begin at Mon 2017-08-07 17:33:47 CEST, end at Tue 2017-08-08 18:03:22 CEST. --
Aug 08 18:03:17 forumeasy.fr plesk_saslauthd[3806]: listen=6, status=5, dbpath='/plesk/passwd.db', keypath='/plesk/passwd_db_key', chroot=1, unprivileged=1
Aug 08 18:03:17 forumeasy.fr plesk_saslauthd[3806]: privileges set to (111:117) (effective 111:117)
Aug 08 18:03:17 forumeasy.fr plesk_saslauthd[3806]: failed mail authenticatication attempt for user 'natalia' (password len=8)
Aug 08 18:03:17 forumeasy.fr postfix/smtpd[3727]: warning: unknown[94.56.56.34]: SASL LOGIN authentication failed: authentication failure
Aug 08 18:03:17 forumeasy.fr postfix/smtpd[3727]: disconnect from unknown[94.56.56.34]
Aug 08 18:03:20 forumeasy.fr postfix/smtpd[3727]: warning: hostname 210-40-204-41.accra.gh.ibcore.net does not resolve to address 41.204.40.210: Name or service not known
Aug 08 18:03:20 forumeasy.fr postfix/smtpd[3727]: connect from unknown[41.204.40.210]
Aug 08 18:03:21 forumeasy.fr plesk_saslauthd[3806]: failed mail authenticatication attempt for user 'natalia' (password len=8)
Aug 08 18:03:21 forumeasy.fr postfix/smtpd[3727]: warning: unknown[41.204.40.210]: SASL LOGIN authentication failed: authentication failure
Aug 08 18:03:22 forumeasy.fr postfix/smtpd[3727]: disconnect from unknown[41.204.40.210]
 
Hi lesny,

as you can see within your output, the direct output of "journalctl -xn" is gone by now for the nginx - start - failure. consider to repeat:
Code:
service nginx restart

followed by

systemctl status nginx.service

followed by

journalctl -xn
... and post again the complete outputs from your command line :)
 
hi,

service nginx restart
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
****@***:~# systemctl status nginx.service
● nginx.service - Startup script for nginx service
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Tue 2017-08-08 20:04:25 CEST; 15s ago
Process: 5450 ExecStartPre=/usr/bin/test $NGINX_ENABLED = yes (code=exited, status=1/FAILURE)

Aug 08 20:04:25 ******* systemd[1]: nginx.service: control process exited, code=exited status=1
Aug 08 20:04:25 ***** systemd[1]: Failed to start Startup script for nginx service.
Aug 08 20:04:25 **** systemd[1]: Unit nginx.service entered failed state.
****@****:~# journalctl -xn
-- Logs begin at Mon 2017-08-07 17:33:47 CEST, end at Tue 2017-08-08 20:04:25 CEST. --
Aug 08 20:03:51 sshd[5433]: Accepted password for root from 88.163.150.236 port 59105 ssh2
Aug 08 20:03:51 sshd[5433]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 08 20:03:51 systemd[1]: Starting Session 566 of user root.
-- Subject: Unit session-566.scope has begun with start-up
-- Defined-By: systemd
-- Support: systemd-devel Info Page
--
-- Unit session-566.scope has begun starting up.
Aug 08 20:03:51 systemd[1]: Started Session 566 of user root.
-- Subject: Unit session-566.scope has finished start-up
-- Defined-By: systemd
-- Support: systemd-devel Info Page
--
-- Unit session-566.scope has finished starting up.
--
-- The start-up result is done.
Aug 08 20:03:51 forumeasy.fr systemd-logind[635]: New session 566 of user root.
-- Subject: A new session 566 has been created for user root
-- Defined-By: systemd
-- Support: systemd-devel Info Page
-- Documentation: multiseat
--
-- A new session with the ID 566 has been created for the user root.
--
-- The leading process of the session is 5433.
Aug 08 20:04:05 forumeasy.fr plesk_saslauthd[5415]: select timeout, exiting
Aug 08 20:04:25 forumeasy.fr systemd[1]: Starting Startup script for nginx service...
-- Subject: Unit nginx.service has begun with start-up
-- Defined-By: systemd
-- Support: systemd-devel Info Page
--
-- Unit nginx.service has begun starting up.
Aug 08 20:04:25 forumeasy.fr systemd[1]: nginx.service: control process exited, code=exited status=1
Aug 08 20:04:25 forumeasy.fr systemd[1]: Failed to start Startup script for nginx service.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: systemd-devel Info Page
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Aug 08 20:04:25 forumeasy.fr systemd[1]: Unit nginx.service entered failed state.
 
Hi lesny,

could you pls. post as well your "/var/log/nginx/error.log"

... and pls. note, that depending to your "nginx.conf" settings, the log - level could be increased to get a more verbose output inside your logs. :)
 
hi,

2017/08/08 12:05:32 [emerg] 16063#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 12:07:09 [emerg] 16251#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 12:07:29 [emerg] 16302#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 12:55:11 [emerg] 4542#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 12:55:25 [emerg] 4591#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 12:57:06 [emerg] 4770#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 12:57:19 [emerg] 4819#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:16
2017/08/08 14:13:31 [emerg] 25105#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:13:51 [emerg] 25155#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:42:00 [emerg] 25833#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:42:17 [emerg] 25887#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:43:26 [emerg] 26541#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:43:46 [emerg] 26593#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:46:44 [emerg] 1346#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 14:46:46 [emerg] 2145#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 15:30:25 [emerg] 20029#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 15:30:26 [emerg] 20078#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 15:30:47 [emerg] 20251#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 15:30:51 [emerg] 20300#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:02:29 [emerg] 430#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:02:32 [emerg] 505#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:37 [emerg] 1268#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:39 [emerg] 1336#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:44 [emerg] 1553#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:45 [emerg] 1591#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:55 [emerg] 1861#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:04:55 [emerg] 1897#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:01 [emerg] 2124#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:02 [emerg] 2170#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:13 [emerg] 2451#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:19 [emerg] 2490#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:32 [emerg] 2785#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:40 [emerg] 2847#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:05:58 [emerg] 3228#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
2017/08/08 16:06:05 [emerg] 3277#0: "http" directive is not allowed here in /etc/nginx/nginx.conf:17
 
my nginx.conf


#user nginx;
worker_processes 1;

#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

#pid /var/run/nginx.pid;

include /etc/nginx/modules.conf.d/*.conf;

events {
worker_connections 1024;
}



http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
#tcp_nodelay on;

#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";

server_tokens off;

include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
 
Hi lesny,

here you go with a working and recommended "nginx.conf":
Code:
    user  nginx;

    worker_processes 1;

    #error_log  /var/log/nginx/error.log;
    #error_log  /var/log/nginx/error.log  notice;
    #error_log  /var/log/nginx/error.log  debug;
    error_log  /var/log/nginx/error.log  warn;

    pid        /var/run/nginx.pid;

    include /etc/nginx/modules.conf.d/*.conf;

    events {
    worker_connections 1024;
    }

    http {
        include       mime.types;
        default_type  application/octet-stream;

        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';

        access_log  /var/log/nginx/access.log  main;

        tcp_nopush    on;
        tcp_nodelay   off;
    
        sendfile      on;

        open_file_cache          max=64000 inactive=5m;
        open_file_cache_valid    2m;
        open_file_cache_min_uses 1;
        open_file_cache_errors   on;

        keepalive_requests 100000;
        keepalive_timeout  180;

        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;

        proxy_buffer_size   128k;
        proxy_buffers   4 256k;
        proxy_busy_buffers_size   256k;

        gzip_static on;
        gzip on;
        gzip_proxied any;
        gzip_http_version 1.1;
        gzip_min_length 100;
        gzip_vary on;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_types audio/wav audio/ogg font/opentype text/css text/javascript text/plain text/richtext text/x-component text/x-js text/xml text/xsd text/xsl font/opentypeapplication/font-woff application/atom+xml application/font-woff2 application/javascript application/java application/json application/msword application/pdf application/xhtml+xml application/xml application/xml+rss image/bmp image/tiff image/svg+xml image/webp image/x-icon application/vnd.ms-access application/vnd.ms-excel application/vnd.ms-fontobject application/vnd.ms-opentype application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-write application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text application/x-font-ttf application/x-font-opentype application/x-font-otf application/x-javascript application/x-msdownload application/x-shockwave-flash application/x-web-app-manifest+json;

        gzip_disable “MSIE [1-6].(?!.*SV1)”;

        server_tokens off;

        include /etc/nginx/conf.d/*.conf;
    }
 
hi,
I think my worries do not come from negnix because despite your sound configuration file I always have the same error I will ask my host a reset of my server I thank you infinitely for your help continues like that it is super d ' To have a community listening to its customers
 
Back
Top