Welcome! Log In Create A New Profile

Advanced

Re: disable .php files uploads using php (php-fpm)

Richard Stanway
August 30, 2016 07:06AM
File uploads are passed in the request body, not the headers so you cannot
disable or otherwise affect them by setting HTTP_X variables. This is a job
for your backend as nginx does not really interact with post body contents.

On Tue, Aug 30, 2016 at 1:54 AM, c0nw0nk <nginx-forum@forum.nginx.org>
wrote:

> Christos Chatzaras Wrote:
> -------------------------------------------------------
> > Is any way to get the body of a php post upload to match using regex
> > the filename of a php upload? I want to block file uploads with .php
> > extension. I found that I can do it with nasxi but I want to see if I
> > can avoid it.
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
>
>
> To disable cookies i do this.
>
> fastcgi_param HTTP_COOKIE "";
>
> PHP accepts the following server vars.
>
> http://php.net/manual/en/reserved.variables.php
>
> It says file uploads are files so it would be this
>
> fastcgi_param HTTP_FILES "";
>
> But if that does not work you may need to do.
>
> fastcgi_param HTTP_POST "";
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?2,269253,269280#msg-269280
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

disable .php files uploads using php (php-fpm)

Christos Chatzaras August 28, 2016 01:12PM

Re: disable .php files uploads using php (php-fpm)

c0nw0nk August 29, 2016 07:54PM

Re: disable .php files uploads using php (php-fpm)

Richard Stanway August 30, 2016 07:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready