Не работает try_files на 0.7.38 - почему?
Igor Sysoev
is at rambler-co.ru
Thu Apr 9 16:01:16 MSD 2009
On Thu, Apr 09, 2009 at 02:42:48PM +0300, Flam Boyant wrote:
> Всем привет!
>
> FreeBSD 6.2, nginx 0.7.38 из портов. Не могу заставить работать try_files
>
> Не ругается, но делает вид, что файлов в /mnt/md/ вообще нет - сразу лезет
> на бекенд.
>
> Конфиг ниже.
>
> ------
>
> error_log /var/log/nginx/error.log info;
>
> pid /var/run/nginx.pid;
>
> events {
> worker_connections 4096;
> kqueue_changes 1024;
> }
>
> http {
> include /usr/local/etc/nginx/mime.types;
> default_type application/octet-stream;
>
> log_format main '$remote_addr - $remote_user [$time_local] "$request" $uri
> '
> '"$status/$upstream_status" $body_bytes_sent '
> '"$host" $request_time "$upstream_addr/$upstream_response_time"';
>
> access_log /var/log/nginx/access.log main;
>
> sendfile on;
> tcp_nopush on;
> tcp_nodelay on;
> keepalive_timeout 65 20;
>
> client_header_timeout 3m;
> client_body_timeout 3m;
> send_timeout 3m;
>
> client_header_buffer_size 4k;
> large_client_header_buffers 4 4k;
>
> client_max_body_size 1m;
> client_body_buffer_size 128k;
>
> output_buffers 4 32k;
> postpone_output 1460;
>
> gzip on;
> gzip_min_length 1024;
> gzip_buffers 12 32k;
> gzip_types text/plain application/xml text/css application/x-javascript;
>
> proxy_connect_timeout 10;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 128k;
> proxy_buffers 4 128k;
> proxy_busy_buffers_size 128k;
> proxy_temp_file_write_size 128k;
> proxy_ignore_client_abort on;
>
> open_file_cache max=10000 inactive=20s;
> open_file_cache_valid 30s;
> open_file_cache_min_uses 2;
> open_file_cache_errors on;
>
> server {
> listen 80 default;
> server_name хххх;
>
> log_not_found on;
>
> location / {
> try_files /mnt/md$uri @root;
- try_files /mnt/md$uri @root;
+ root /mnt/md;
+ try_files $uri @root;
> auth_basic "Restricted";
> auth_basic_user_file /usr/local/etc/apache22/http.passwd;
> }
>
> location @root {
> root /ftp/pub;
> fancyindex on;
> fancyindex_exact_size on;
> fancyindex_header /index/header_n.html;
> fancyindex_footer /index/footer_n.html;
> auth_basic "Restricted";
> auth_basic_user_file /usr/local/etc/apache22/http.passwd;
> }
>
> location = /_.gif {
> empty_gif;
> }
>
> error_page 500 502 503 504 /50x.html;
> location = /50x.html {
> root /usr/local/www/nginx;
> }
>
> location ~ /\.ht {
> deny all;
> }
> }
> }
--
Игорь Сысоев
http://sysoev.ru
More information about the nginx-ru
mailing list