If you want, you can have only files with specific extensions to be
served as static content by nginx. Other files usually classified as
static content are served by Apache. It is important to note that under
this scenario, requests for files with the specified extensions never
reach Apache at all. Consequently, they do not pass through Apache
handlers. This means, for example, that rewrite rules or .htaccess
directives are not applied.
To serve only specific static content via nginx:
- Go to Websites & Domains > Apache & nginx Settings and scroll
down to the “nginx settings” section. - Select the Proxy mode and Serve static files directly by
nginx checkboxes. - By default, certain static files extensions are already preconfigured
in the Serve static files directly by nginx box. You can add or
remove the extensions as necessary. Separate individual file
extensions using whitespaces or the “|” character. - Click OK.
Note: Enabling the “Serve static files directly by nginx” option
automatically disables the default “Smart static files processing”
mode, even if the checkbox of the latter remains selected.