Maxim Dounin wrote:
> Use map instead:
Thanks, map works nicely :)
> avoid using such "timestamped log names" at all as this approach implies
unneeded overhead on opening/closing files for each request.
I use open_log_file_cache to mitigate this. Are there still problems with
that? I would pr
I use the if trick to get timestamped log names:
if ($time_iso8601 ~ "^(\d{4})-(\d{2})") {
set $year $1;
set $month $2;
}
access_log .../access-$year-$month.log combined;
However, with nginx/1.4.6 (Ubuntu) I see that for invalid HTTP requests
$year and $month are not set. For exa
Thanks again for detailed explanation. Now I almost grasped how try_files
works. "Almost" because I still do not see why the following does not work:
server {
listen 8080 default_server;
root /usr/share/nginx/html;
autoindex on;
location /x/ {
alias /test/;
location ~ ^/x/(test.*) {
try_files $1
That does not work either. What works is try_files "" =404 together with an
explicit alias as Francis Daly described in another post.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,254033,254043#msg-254043
___
nginx mailing list
nginx@nginx.o
Thanks, try_files "" =404 works indeed as long as the regexp location block
contains the necessary alias. I.e. the original example modified like in:
server {
listen 8080 default_server;
root /usr/share/nginx/html;
autoindex on;
location /x/ {
alias /test/;
location ~ ^/x/test {
I tried that, but it still does not work. The following config as before
still gives 404 for localhost/x/test.html :
server {
listen 8080 default_server;
root /usr/share/nginx/html;
autoindex on;
location /x/ {
alias /test/;
}
locat
I tried to add explicit alias to the regexp location:
server {
listen 8080 default_server;
root /usr/share/nginx/html;
autoindex on;
location /x/ {
alias /test/;
}
location ~ ^/x/(test.*)$ {
alias /test/$1;
I could not figure out why try_files in a nested location defined with a
regexp does not work in nginx/1.4.6 under Ubuntu 14.04. Consider the
following config:
server {
listen 8080 default_server;
root /usr/share/nginx/html;
autoindex on;
location /x/ {