debian - Virtualmin - nginx document roots not displaying correctly
2014-07
I recently set up Virtualmin on a clean Debian7-32bit VPS. I decided to go with nginx instead of Apache.
Virtualmin sets up separate config files for each "virtual host", which I guess is fine. I have 3 domain names: Domain 1 is the main site (/home/joey), while Domain 2 and Domain 3 are subdirectories (/home/joey/s1 and /home/joey/s2). The document roots for each host are set up has such, however when I enter each domain in my web broswer I am brought to the main site. Basically, Domains 1, 2, and 3 all show the document root of Domain 1.
Is there something wrong with my configuration? Maybe I need something in my host records for each domain (on NameCheap)? This hadn't happened before I wiped my VPS and reinstalled Debian, when I was running apache.
The location from nginx conf:
location ~/photos/resize/(\d+)/(\d+) {
# Here var1=(\d+), var2=(\d+)
}
How to I get variables from location in nginx?
The regex works pretty much like in every other place that has it.
location ~/photos/resize/(\d+)/(\d+) {
# use $1 for the first \d+ and $2 for the second, and so on.
}
Looking at examples on the nginx wiki may also help, http://wiki.nginx.org/Configuration
You may try this:
location ~ ^/photos/resize/.+ {
rewrite ^/photos/resize/(\d+)/(\d+) /my_resize_script.php?w=$1&h=$2 last;
}