Well you can use Apache -->> Nginx -->> PHP-FPM
#Apache
<VirtualHost *:8081>
ServerName example.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
</VirtualHost>
#Nginx
server {
listen 80;
root /var/www/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
# gzip_static on;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
You also can go Apache -->>PHP-FPM
(Docs)
<VirtualHost *:8081>
ServerName example.com
ProxyPreserveHost On
ProxyPass / fcgi://127.0.0.1:9000/
ProxyPassReverse / fcgi://127.0.0.1:9000/
</VirtualHost>