You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Natassia <na...@protonmail.com.INVALID> on 2021/08/05 00:34:51 UTC
[users@httpd] Using "AddHandler" with "mod_proxy"
Hello,
I have a situation that I am trying to resolve since Monday.
I am starting to deploy PHP-FPM on a server infrastructure.
Until now, I was using a .htaccess to change the PHP version in a folder.
AddHandler application/x-httpd-php74 .php
With FPM in socket, it is impossible to use this system.
<FilesMatch "\.php$">
SetHandler "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/"
</FilesMatch>
I can put this in an .htaccess, it works:
Addhandler "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/" .php
But I have very old applications that change the .htaccess files every hour. It's stupid, but they are closed sources...
I found a possible solution:
=> .htaccess:
AddHandler ${application/x-httpd-php74} .php
=> VHOST:
Define "application/x-httpd-php74" "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/"
But the problem is the "${" and "}" in the file that is needed.
After I found that with "mod_actions" there would be a possibility, but it does not want "proxy:" in the function.
Do you have a solution to have the line "AddHandler application/x-httpd-php74 .php" that allows to run "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/" ?
I would like to create my own AddHandler to do an action if => make this :)
Bests regards,
Natassia
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Using "AddHandler" with "mod_proxy"
Posted by Natassia <na...@protonmail.com.INVALID>.
On Thursday, August 5th, 2021 at 02:50, Eric Covener <co...@gmail.com> wrote:
>
> It looks like types set via RewriteRule H= flag will override the type
>
> set by mod_mime/AddHandler.
Hi Eric,
Unable to create my Handler with a rule :-(
In the Apache documentation, I understand that it is to force with a Handler that already exists and not to create a new Handler that must go to the proxy.
Natassia
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Using "AddHandler" with "mod_proxy"
Posted by Eric Covener <co...@gmail.com>.
On Wed, Aug 4, 2021 at 8:35 PM Natassia
<na...@protonmail.com.invalid> wrote:
>
> Hello,
>
> I have a situation that I am trying to resolve since Monday.
>
> I am starting to deploy PHP-FPM on a server infrastructure.
> Until now, I was using a .htaccess to change the PHP version in a folder.
>
> AddHandler application/x-httpd-php74 .php
>
> With FPM in socket, it is impossible to use this system.
>
> <FilesMatch "\.php$">
> SetHandler "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/"
> </FilesMatch>
>
> I can put this in an .htaccess, it works:
>
> Addhandler "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/" .php
>
> But I have very old applications that change the .htaccess files every hour. It's stupid, but they are closed sources...
>
> I found a possible solution:
>
> => .htaccess:
> AddHandler ${application/x-httpd-php74} .php
>
> => VHOST:
> Define "application/x-httpd-php74" "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/"
>
> But the problem is the "${" and "}" in the file that is needed.
>
> After I found that with "mod_actions" there would be a possibility, but it does not want "proxy:" in the function.
>
> Do you have a solution to have the line "AddHandler application/x-httpd-php74 .php" that allows to run "proxy:unix:/tmp/dev-fpm/natassia-fpm.sock|fcgi://localhost/" ?
> I would like to create my own AddHandler to do an action if => make this :)
>
It looks like types set via RewriteRule H= flag will override the type
set by mod_mime/AddHandler.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org