Want more timely Centmin Mod News Updates?
Become a Member

Nginx Allow only uploads with specific extension Nginx rewrite rule

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Apr 28, 2019.

  1. pamamolf

    pamamolf Well-Known Member

    4,126
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    8:45 PM
    Nginx-1.29.x
    MariaDB 10.6.x
    Hello

    How can i allow only one specific extension for upload using Nginx rewrite rule?

    Thank you

     
  2. eva2000

    eva2000 Administrator Staff Member

    59,369
    12,513
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,149
    Local Time:
    3:45 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Wouldn't you do that from the web application layer to control what extensions are uploaded in the web app rather than using nginx to control it.
     
  3. pamamolf

    pamamolf Well-Known Member

    4,126
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    8:45 PM
    Nginx-1.29.x
    MariaDB 10.6.x
    Yes but i was thinking to have an extra layer for security on that :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    59,369
    12,513
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,149
    Local Time:
    3:45 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Nginx isn't the best way to limit POST requests for this. It should be handled by your web app.