• 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
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Resolved "Smart static files processing" is not working anymore

Hangover2

Regular Pleskian
Username:

TITLE

"Smart static files processing" is not working anymore

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian 18.0.60 Update #1

PROBLEM DESCRIPTION

When "Smart static files processing" is enabled for a website, some static files should be delivered by Nginx instead of Apache. This is not the case anymore.

STEPS TO REPRODUCE

- activate "Smart static files processing" for a website
- create a static file called "test.txt" in the root directory of the website
- call the file directly
- check Apache and Nginx access log

ACTUAL RESULT

- the file gets delivered by Apache

EXPECTED RESULT

- the file gets delivered by Nginx

ANY ADDITIONAL INFORMATION

We did check the behavior on an older Plesk server with "Version 18.0.57 Update #3". Here the file gets still delivered by Nginx. We did check the nginx.conf of both systems. Plesk Obsidian 18.0.60 Update #1 is missing the following config rule:

Code:
location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip|webp))$ {
   try_files $uri @fallback;
}

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Based on the information in your bug report we could not find any issues. We ran some tests but couldn't observe any difference in the way "Smart static files processing" works in version .57 or .60.

Perhaps there's some confusion on what the "Smart static files processing" option actually does? (It was eye opening for me at least). Bear with me while I try to explain what it exactly does.

However let me first point out that the code block with all the file extensions you posted belongs to the "Serve static files directly by nginx" option. It's only gets added to the domains nginx.conf file when the option is enabled. It's unrelated to "Smart static files processing".
Code:
location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip|webp))$ {
   try_files $uri @fallback;
}

When the "Smart static files processing" option is enabled the following code block gets added to the domains nginx.conf. However only if the "Serve static files directly by nginx" option is not enabled too.
Code:
location ^~ /internal-nginx-static-location/ {
       alias /var/www/vhosts/mayometer.nl/httpdocs/;
       internal;
}

With this code block "Smart static files processing" ensures that each request is passed to Apache. Which, if it's static file, returns only a file location back to Nginx. The file then gets located and delivered by Nginx to the client. The documentation page explains this quite well (I think).

71998.webp

71999.webp


There is a caveat however, which is that there is an minimal file size of 1K defined. Files smaller than 1K will be served by Apache directly. This explains why the text file you mentioned in your STR get served by Apache and not by Nginx as you expected.

You mentioned that the text file on your .57 server does get served by Nginx. That's most likely (based on the information you posted) because of the Serve "static files directly by nginx" code block.

Hopefully this clarifies what the "Smart static files processing" option does and what you can expect from it :)

In case your interested in some more background information about how Nginx and Apache get used in Plesk can be found here.
 
@Kaspar@Plesk Thanks for the clarification. The minimal file size + the different behavior when "Serve static files directly by nginx" is activated caused our confusion. The topic can be marked as resolved. Everything works fine and as expected related to the Plesk documentation.
 
Back
Top