TITLE:
Hotlink protection disables Expire headers
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:Plesk Onyx , Version 17.8.11 Update #35, last updated on Dec 18, 2018 01:06 PM, Ubuntu 16.04.5 LTS
PROBLEM DESCRIPTION:When enabled Hotlink protection (can be reverted) in WordPress (extension) > Security Status, Expire headers like cache-control:max-age=31536000, public disappear from headers. If disabled Hotlink protection, they appear again.
This happens in both Nginx only hosting and with Nginx proxying Apache.
Not only
STEPS TO REPRODUCE:This happens in both Nginx only hosting and with Nginx proxying Apache.
Not only
When enabled Hotlink protection (can be reverted) in WordPress (extension) > Security Status, Expire headers like cache-control:max-age=31536000, public disappear from headers. If disabled Hotlink protection, they appear again.
Additional Nginx directive: (the last line is optional does not work with or without)
location ~* .(js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|svg|mp4|m4v)$ {
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
add_header Link "<$scheme://$http_host$request_uri>; rel=\"canonical\"";
}
ACTUAL RESULT:Additional Nginx directive: (the last line is optional does not work with or without)
location ~* .(js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|svg|mp4|m4v)$ {
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
add_header Link "<$scheme://$http_host$request_uri>; rel=\"canonical\"";
}
curl -I -c - https://www.example.com/wp-content/uploads/example.png -k
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 28 Dec 2018 16:11:23 GMT
Content-Type: image/png
Content-Length: 13335
Last-Modified: Tue, 18 Dec 2018 23:54:15 GMT
Connection: keep-alive
ETag: "5c1988a7-3417"
Accept-Ranges: bytes
EXPECTED RESULT:HTTP/1.1 200 OK
Server: nginx
Date: Fri, 28 Dec 2018 16:11:23 GMT
Content-Type: image/png
Content-Length: 13335
Last-Modified: Tue, 18 Dec 2018 23:54:15 GMT
Connection: keep-alive
ETag: "5c1988a7-3417"
Accept-Ranges: bytes
curl -I -c - https://www.example.com/wp-content/uploads/example.png -k
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 28 Dec 2018 16:11:23 GMT
Content-Type: image/png
Content-Length: 13335
Last-Modified: Tue, 18 Dec 2018 23:54:15 GMT
Connection: keep-alive
ETag: "5c1988a7-3417"
Pragma: public
Cache-Control: max-age=31536000, public
Link: <https://www.example.com/wp-content/uploads/example.png>; rel="canonical"
Accept-Ranges: bytes
ANY ADDITIONAL INFORMATION:HTTP/1.1 200 OK
Server: nginx
Date: Fri, 28 Dec 2018 16:11:23 GMT
Content-Type: image/png
Content-Length: 13335
Last-Modified: Tue, 18 Dec 2018 23:54:15 GMT
Connection: keep-alive
ETag: "5c1988a7-3417"
Pragma: public
Cache-Control: max-age=31536000, public
Link: <https://www.example.com/wp-content/uploads/example.png>; rel="canonical"
Accept-Ranges: bytes
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:Confirm bug