PHP Warning: Undefined array key "HTTP_HOST" in /var/www/vhosts/example.com/httpdocs/wp/wp-admin/includes/misc.php
fastcgi_param HTTP_HOST $host;
# service nginx restart
; Enable xdebug extension module
zend_extension=xdebug.so
xdebug.mode=debug,develop
xdebug.client_host=127.0.0.1
xdebug.client_port="9003"
# systemctl restart plesk-php83-fpm
# yum remove ImageMagick ImageMagick-devel
# yum install epel-release yum-utils -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# yum-config-manager --enable remi
# yum install ImageMagick7 ImageMagick7-libs ImageMagick7-devel -y
# yum groupinstall 'Development Tools'
# /opt/plesk/php/8.2/bin/pecl install Imagick
# mv /opt/plesk/php/8.2/lib64/php/modules/imagick.so /opt/plesk/php/8.2/lib64/php/modules/imagick_new.so
# echo "extension=imagick_new.so" > /opt/plesk/php/8.2/etc/php.d/imagick.ini
c:\> iisreset
map $http_user_agent $badagent {
default 0;
~*hello 1;
~*world 1;
~*helloworld 1;
}
if ($badagent) {
return 403;
}
map $http_x_requested_with $error_doc_format {
default html;
XMLHttpRequest json;
}
map $http_x_forwarded_proto $original_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_user_agent $badagent {
default 0;
~*hello 1;
~*world 1;
~*helloworld 1;
}
server {
listen 8443 ssl;
listen 8880;
listen 127.0.0.1:8880 default_server;|
include conf.d/*ipv6_ports.inc;
http2 on;
ssl_certificate /opt/psa/admin/conf/httpsd.pem;
ssl_certificate_key /opt/psa/admin/conf/httpsd.pem;
include conf.d/*plesk.inc;
include conf.d/*wpb.inc;
if ($badagent) {
return 403;
}
}
# systemctl restart sw-cp-server
# curl -Ik https://example.com:8443 -A "hello"
HTTP/2 403
server: nginx
date: Mon, 24 Mar 2025 19:29:54 GMT
content-type: text/html
content-length: 146
# curl -Ik 10.69.45.153:8880 -A hello
HTTP/1.1 404 Not Found
Content-Length: 929
Content-Type: text/html
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
Date: Tue, 25 Mar 2025 14:47:08 GMT
Connection: close
[code]# curl -Ik 10.69.45.153:8880 -A world
curl: (56) Recv failure: Connection reset by peer
[/code]# dnf swap mod_security mod_security --enablerepo=PLESK_18_0_70-extras --disablerepo=atomic --skip-broken
421 Misdirected Request
The following error message is logged in domain's log ([b]Plesk > Domains > example.com > Logs[/b]):
AH02032: Hostname default-203_0_113_2 (default host as no SNI was provided) and hostname www.example.com provided via HTTP have no compatible SSL setup
# echo -e "proxy_ssl_server_name on;\nproxy_ssl_name \$host;\nproxy_ssl_session_reuse off;" > /etc/nginx/conf.d/fixssl.conf && systemctl restart nginx
Aug 19 12:15:14 [HOSTNAME] kernel: traps: php-fpm[PID] general protection fault ip:7f2e3875ecbf sp:7ffdbfc1c3c0 error:0 in libhs_runtime.so.5.4.0[7f2e3849c000+3b0000]
Aug 19 12:15:16 [HOSTNAME] kernel: traps: php-fpm[PID] general protection fault ip:7f2e3875ecbf sp:7ffdbfc1c3c0 error:0 in libhs_runtime.so.5.4.0[7f2e3849c000+3b0000]
ERR_TOO_MANY_REDIRECTS