Roman Vasilyev
December 06, 2011 07:18PM
я так понимаю это единственный метод :(
как то коряво получается :(
http://abarmotik.livejournal.com/7496.html

# В этот локейшн переходим по хедеру X-Accel-Redirect от бэк-енда.
# (предполагается, что все раздаваемые файлы лежат в папке /storage)
location /storage {
set $postURI $uri;
set $postIP $remote_addr;
set $postHOST $host;

post_action @postDownload;

root /;
internal;
}

location @postDownload {
proxy_pass
http://127.0.0.1:8888/nginxds/postDownload?domain=$postHOST&uri=$postURI;
proxy_set_header X-Real-IP $postIP;
proxy_set_header BytesSent $body_bytes_sent;
}


On 12/06/2011 03:53 PM, Roman Vasilyev wrote:
> Следующая проблемка, кусок конфига
> location /download {
> rewrite ^ /uwsgi/download.py last;
> location /download/storage/ {
> internal;
> alias /$1;
> post_action /uwsgi/last.py;
> }
> }
> download определяет положение файла из python скрипта с помощью
> "X-Accel-Redirect"
>
> нужно дернуть post_action с параметрами файла? наткнулся на следующее
> поведение, когда дописываю вопрос в параметре post_action скрипт
> вообще прекращает вызываться, не посоветуете как туда передать
> дополнительные параметры?
> тоесть нужно написать нечто вроде post_action /uwsgi/last.py?file=$1;
>
> # /usr/sbin/nginx -V
> nginx version: nginx/1.1.8
> built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
> TLS SNI support disabled
> configure arguments: --with-debug --user=fileservices
> --group=fileservices --prefix=/usr/share/nginx
> --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf
> --error-log-path=/var/log/nginx/error.log
> --http-log-path=/var/log/nginx/access.log
> --http-client-body-temp-path=/var/lib/fileservices/tmp/client_body
> --http-proxy-temp-path=/var/lib/fileservices/tmp/proxy
> --http-fastcgi-temp-path=/var/lib/fileservices/tmp/fastcgi
> --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx
> --with-http_ssl_module --with-http_realip_module
> --with-http_addition_module --with-http_sub_module
> --with-http_dav_module --with-http_flv_module
> --with-http_gzip_static_module --with-http_stub_status_module
> --with-http_perl_module --with-mail --with-mail_ssl_module
> --with-http_secure_link_module --with-http_random_index_module
> --with-http_xslt_module --with-cc-opt='-O2 -g -m64 -mtune=generic'
> --add-module=../src/ngx_http_body_size_module
> --add-module=../src/ngx_subrequest_module
> --add-module=/root/work/nginx/branches/1.1.8/BUILD/nginx-1.1.8/vkholodkov-nginx-upload-module-8d271b1
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

параметры для post_action

Roman Vasilyev December 06, 2011 06:54PM

Re: параметры для post_action

Roman Vasilyev December 06, 2011 07:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 243
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready