• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Missing escape character in "additional webserver header" entries in nginx.conf file when quotation marks are used

Bitpalast

Plesk addicted!
Plesk Guru
Username:

TITLE


Missing escape character in "additional webserver header" entries in nginx.conf file when quotation marks are used

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Obsidian 18.0.46, latest MU
CentOS 7.9

PROBLEM DESCRIPTION

I tried to enter an additional webserver header for Apache like

Code:
Link: <https://de-example.com>; rel="alternate"; hreflang="de", <https://en-example.com>; rel="alternate"; hreflang="en"

But when I run
Code:
# curl -I https://de-example.com
I get this result:
Code:
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 25 Aug 2022 16:26:43 GMT
.
.
.
Link: <https://de-example.com>; rel="alternate"; hreflang="de", <https://en-example.com>; rel="alternate"; hreflang="en
X-Powered-By: PleskLin
--> The last double quotation mark " is missing from the added line. It should end with hreflang="en".

In the corresponding nginx.conf file of the subscription account, where these headers are placed, there seems to be an escape \ missing. The line there is

Code:
add_header "Link" "<https://de-example.com>; rel=\"alternate\"; hreflang=\"de\", <https://en-example.com>; rel=\"alternate\"; hreflang=\"en";

But it should be:

Code:
add_header "Link" "<https://de-example.com>; rel=\"alternate\"; hreflang=\"de\", <https://en-example.com>; rel=\"alternate\"; hreflang=\"en\";

STEPS TO REPRODUCE

1) In the GUI go to "additional webserver headers" and add
Code:
Link: <https://de-example.com>; rel="alternate"; hreflang="de", <https://en-example.com>; rel="alternate"; hreflang="en"
2) Save the configuration
3) Either look into /var/www/vhosts/<system>/de-example.com/conf/nginx.conf
or run
Code:
curl -I https://de-example.com
to see what's in the web server.

ACTUAL RESULT

Code:
Link: <https://de-example.com>; rel="alternate"; hreflang="de", <https://en-example.com>; rel="alternate"; hreflang="en

EXPECTED RESULT

Code:
Link: <https://de-example.com>; rel="alternate"; hreflang="de", <https://en-example.com>; rel="alternate"; hreflang="en"

ANY ADDITIONAL INFORMATION

The reason is that the last escape \ is missing from the nginx.conf configuration file when the line is saved.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Thank you, Peter.
Confirmed and submitted as PPPM-13695
 
Back
Top