Welcome! Log In Create A New Profile

Advanced

Re: resize image как задать переменную, если ее нет в аргументах

June 17, 2015 02:03AM
спасибо.

вылезла не понятная мне проблема (
завел переменные с проверкой

server {
listen 80;
server_name static.vhost static.vhost2;

location ~ ^/(.*\.(?:jpg|gif|png))$ {
alias /home/$host$uri;
set $q 75;
if ($arg_q) {
set $q $arg_q;
}
if ($arg_s) {
set $s $arg_s;
}
image_filter resize $s -;
image_filter_jpeg_quality $q;
access_log /var/log/nginx/access.img.log;
error_page 415 = @images;
}

location @images {
root /home/$host;
}
}

развалилось )

в дебаге вот такое

2015/06/17 05:06:27 [debug] 818#0: *105 content phase: 22
2015/06/17 05:06:27 [debug] 818#0: *105 http script copy: "/home/"
2015/06/17 05:06:27 [debug] 818#0: *105 http script var: "static.vhost"
2015/06/17 05:06:27 [debug] 818#0: *105 http script var: "/bg.png"
2015/06/17 05:06:27 [debug] 818#0: *105 http filename: "/home/static.vhost/bg.png1.1
Host"
2015/06/17 05:06:27 [debug] 818#0: *105 add cleanup: 00000000010BE2C0
2015/06/17 05:06:27 [error] 818#0: *105 open() "/home/stati" failed (2: No such file or directory), client: 172.17.42.1, server: static.vhost, request: "GET /bg.png?s=280&q=20 HTTP/1.1", host: "static.vhost"
2015/06/17 05:06:27 [debug] 818#0: *105 http finalize request: 404, "/bg.png?s=280&q=20" a:1, c:1
2015/06/17 05:06:27 [debug] 818#0: *105 http special response: 404, "/bg.png?s=280&q=20"
2015/06/17 05:06:27 [debug] 818#0: *105 http set discard body
2015/06/17 05:06:27 [debug] 818#0: *105 uploadprogress error-tracker error: 404
2015/06/17 05:06:27 [debug] 818#0: *105 uploadprogress error-tracker not tracking in this location
2015/06/17 05:06:27 [debug] 818#0: *105 http output filter "/bg.png?s=280&q=20"
2015/06/17 05:06:27 [debug] 818#0: *105 http copy filter: "/bg.png?s=280&q=20"
2015/06/17 05:06:27 [debug] 818#0: *105 image filter
2015/06/17 05:06:27 [debug] 818#0: *105 image filter: "<h"
2015/06/17 05:06:27 [debug] 818#0: *105 http special response: 415, "/bg.png?s=280&q=20"
2015/06/17 05:06:27 [debug] 818#0: *105 http set discard body
2015/06/17 05:06:27 [debug] 818#0: *105 uploadprogress error-tracker error: 415
2015/06/17 05:06:27 [debug] 818#0: *105 uploadprogress error-tracker not tracking in this location
2015/06/17 05:06:27 [debug] 818#0: *105 xslt filter header
2015/06/17 05:06:27 [debug] 818#0: *105 HTTP/1.1 415 Unsupported Media Type


" http filename: "/home/static.vhost/bg.png1.1
Host""

что странно, при использовании в image_filter $arg_s и image_filter_jpeg_quality $arg_q (при заданных агрументах) путь формируется правильно.

я не правильно пути для alias формирую?
Subject Author Posted

resize image как задать переменную, если ее нет в аргументах

cilrill June 16, 2015 07:53PM

Re: resize image как задать переменную, если ее нет в аргументах

Maxim Dounin June 16, 2015 10:38PM

Re: resize image как задать переменную, если ее нет в аргументах

cilrill June 17, 2015 02:03AM

Re: resize image как задать переменную, если ее нет в аргументах

Maxim Dounin June 17, 2015 09:06AM

Re: resize image как задать переменную, если ее нет в аргументах

cilrill June 17, 2015 03:59PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready