Categories
How to add extension to uri in nginx?
It is necessary that nginx requests like: localhost/zbx/$filename be remade into localhost/zbx/$filename.jpg
location /zbx/ { rewrite ^[\w|\d|\ |\_|\-]+(?!\.pdf)$ $1.jpg permanent; return 301; }
Answer the question
In order to leave comments, you need to log in
location ~ ^/zbx/ { try_files $uri $uri.pdf =404; }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question