Kek, just realised that you can actually use map directive to declare variables in http block. :)
This commit is contained in:
parent
98b38376b5
commit
4fd1d46a30
@ -55,3 +55,9 @@ block article
|
|||||||
| location /assets/ {
|
| location /assets/ {
|
||||||
| alias $root/homepage/static/assets/;
|
| alias $root/homepage/static/assets/;
|
||||||
| }
|
| }
|
||||||
|
p The very reason why I had to use variables is that #[code alias] doesn't work with relative paths. I wish #[code alias] could be relative to #[code root], but we are forced to look for workarounds.
|
||||||
|
p Update: Oh, I realised that you can declare variables in #[code http] block using #[code map] directive with #[code default] set to value you need. Funny, I've been using #[code map] to prevent LAN IPs from being logged all this time, heh. So, here's example:
|
||||||
|
pre
|
||||||
|
| map 1 $root {
|
||||||
|
| default /srv/http/dwelling;
|
||||||
|
| }
|
||||||
|
Loading…
Reference in New Issue
Block a user