| From | Sent On | Attachments |
|---|---|---|
| Jools Wills | Jun 17, 2009 3:37 pm | |
| Edho P Arief | Jun 17, 2009 7:33 pm | |
| Jools Wills | Jun 17, 2009 11:43 pm | |
| Edho P Arief | Jun 18, 2009 12:08 am | |
| Igor Sysoev | Jun 18, 2009 12:40 am | |
| Edho P Arief | Jun 18, 2009 1:13 am | |
| Igor Sysoev | Jun 18, 2009 1:21 am | |
| Edho P Arief | Jun 18, 2009 1:39 am | |
| Igor Sysoev | Jun 18, 2009 1:46 am | |
| Jools Wills | Jun 18, 2009 4:17 am | |
| Jools Wills | Jun 18, 2009 4:21 am | |
| Igor Sysoev | Jun 18, 2009 4:33 am | |
| Jools Wills | Jun 20, 2009 8:27 am | |
| Igor Sysoev | Jun 20, 2009 8:37 am |
| Subject: | Error with config when upgrading from 0.6.34 to 0.7.59 (the "alias" directive must use captures inside location given by regular expression) | |
|---|---|---|
| From: | Jools Wills (bu...@exotica.org.uk) | |
| Date: | Jun 17, 2009 3:37:35 pm | |
| List: | ru.sysoev.nginx | |
I got an error
the "alias" directive must use captures inside location given by regular expression in /etc/nginx/sites-enabled/default:70
Quite a confusing message for me. The line in question.
alias /home/$homedir/public_html/;
which comes from
# For requests starting with a tilde, break them into three components: # 1. The username, everything after the tilde up to the first slash # 2. The file location, everything after the username up to the last slash # 3. The trailing slash(es) # Then, rewrite to go to the f~/ branch. location /~ { if ($request_uri ~ ^/~([^/]*)(/.*[^/]|)(/*)$) { set $homedir $1; set $filedir $2; set $trailingslashes $3; rewrite ^/~([^/]*)(/|$)(.*)$ f~/$3; } }
# Here, the user-directory components have been parsed. Use an alias to set # the file directory prefix. But if the file at the requested URI is a # directory, we jump to the ~/ branch for additional processing. location f~/ { alias /home/$homedir/public_html/; if (-d /home/$homedir/public_html$filedir) { rewrite ^f~/(.*) ~/$1; } }
# Here, the request is for a directory in a user's home directory. We check # that the request URI contained trailing slashes. If it did not, then we # add the slashes and send a redirect. This circumvents Nginx's faulty # internal slash-adding mechanism. location ~/ { autoindex on; alias /home/$homedir/public_html/; if ($trailingslashes = "") { rewrite .* /~$homedir$filedir/ redirect; } }
(this code comes from this blog http://blog.sbf5.com/?p=6)
Any ideas what this new error means. Seems related to a "new" feature added in 0.7.40.
Best Regards
Jools





