Answer the question
In order to leave comments, you need to log in
How to set up nginx?
Hello!
I need to make sure that all files with a URL starting with /uploads/ are served from ask-me/uplods
And all files with an extension (.js .css .jpeg, etc.) are served from the ask-me/static
directory this can be done?
What should be written in nginx.conf ?
Thank you!
Answer the question
In order to leave comments, you need to log in
Try like this
location ~* ^/uploads/(.+)$ {
alias /data/www/ask-me/uplods/$1;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|pdf|txt|tar|bmp|js|mov|xml|flv|f4v)$ {
root /data/www/ask-me/static;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question