Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Alias css|img|js to assets

$
0
0
I'm trying setup a location alias and am pulling my hair out. I'd like requests for example.com/(css|img|js) to alias to example.com/assets/(css|img|js), but for the life of me cannot get it working.

Here's what I have thus far:

location ~ ^/(css|js|img)/(.*)$ {
alias /srv/http/example.com/public_html/assets/$1/$2;
}

This seems to direct to the proper folder, but if says file not found when I try to access an actual file.

I'm missing something simple I feel, but not a clue what...

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>