M
M
mmailcompany2021-08-15 12:02:00
Nginx
mmailcompany, 2021-08-15 12:02:00

All format files except for a specific one?

Good day.
It costs nginx and behind it apache

Tell me how to properly exclude a file with a specific name from the regular expression.

Example:

exclude file named my.jpg from regular expression

location ~* ^.+\.(...|ico|jpeg|jpg|...)$ {
  ...
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Page-Audit.ru, 2021-08-15
@mmailcompany

Priorities location , but it is better to read in the original dock.

location = my.jpg {
  ...
}

location ~* ^.+\.(...|ico|jpeg|jpg|...)$ {
  ...
}

or like this
location ~ ^my\.jpg$ {
  ...
}

location ~* ^.+\.(...|ico|jpeg|jpg|...)$ {
  ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question