nginx_user10 Wrote:
-------------------------------------------------------
> I am trying to serve images files only in this location block.
>
> location /image \.(png|jpg)
> {
> alias /site/;
> }
>
> But I keep receiving errors. What is the correct way to serve only png
> and jpg matching /images.
*********************** update *************************
This location block works if I put a redirect in the block. But if I try to show the image via <img src or make a link clickable nothing works.
location ~* /images2/.+\.(png|jpg)$
{
}
The error logs says the following
GET /images2/flowers/type/T.png/ HTTP/1.1" 404 209
-------------------------------------------------------
> I am trying to serve images files only in this location block.
>
> location /image \.(png|jpg)
> {
> alias /site/;
> }
>
> But I keep receiving errors. What is the correct way to serve only png
> and jpg matching /images.
*********************** update *************************
This location block works if I put a redirect in the block. But if I try to show the image via <img src or make a link clickable nothing works.
location ~* /images2/.+\.(png|jpg)$
{
}
The error logs says the following
GET /images2/flowers/type/T.png/ HTTP/1.1" 404 209