P
P
Pista2019-10-08 18:49:37
Nginx
Pista, 2019-10-08 18:49:37

How to set nginx location to use one folder for all sites?

I have 5 sites on which I use graphics from the images folder, how to set up the Nginx config for domains so as not to upload the Images folder to each site, but access the shared folder for all domains , which will be located along the path /var/www/images

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-10-08
@Pista

location ^~ /images {
    root /var/www;
}

A
Alexey Dmitriev, 2019-10-08
@SignFinder

What's stopping you from making a symlink named images to each site directory from the real directory?
No additional moves from nginx will be needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question