There is such a part of the nginx config
location ~ ^/backend/((img/|css/|fonts/|js/).*)$ { alias /var/www/project/application/backend/static/$1; access_log off; expires max; } How to rewrite it under apache?
Your question has no particular practical meaning.
When similar constructions are used in nginx, this means that there are two web servers that are located one after another: nginx as a frontend (as a rule, distributes static) and httpd as a backend (gives dynamic content together with PHP).
In the case when you want to remove nginx and leave only one Apache, the meaning in the proxying directive to the backend disappears. Purely hypothetically, there are very rare configurations with mod_proxy (when another web server is behind Apache), but there is no practical sense.
Therefore, it only makes sense to rewrite the access_log off and expires max directives for static.
The first one in general in terms of apache does not make sense: in the Apache, you can disable error_log, but completely disable access_log (at least, out of the box using standard tools is impossible.
For expire_max (I haven’t been able to make a mistake on the Apache for a hundred years) there is a separate mod_expires.
In any case, I repeat once again: moving away from a bunch of two web servers to one, these directives of forwarding from one web server to another degenerate.
In addition, if you want to get away from nginx + apache, then a more modern option is to go to the “clean” nginx (and use php-fpm as a backend for PHP, and not apache + PHP).
Source: https://ru.stackoverflow.com/questions/744904/
All Articles