Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Илья Шипицин
а расскажите, о каких ресурсах идет речь ?
если это js/css/картинка, ее всегда можно переименовать с хешем и
добавить Cache-Control: max-age=очень-много

и никаких 304-х (браузер делает If-none-match/if-modified-since только
в случае, если в ответе не было max-age или Expire)

4 января 2014 г., 10:25 пользователь S.A.N nginx-fo...@nginx.us написал:
 Теперь все работает правильно, при клиент кешировании, мы в заголовок
 Cache-Control пишем дерективу private, это запретит Nginx кешировать
 данный ответ и таким образом он не попадет в кеш не при 200 статусе и
 так же ответ в 304 статусе в кеш не попадет.

 Я поспешил с выводами, что проблема решена.
 Для клиент (private) кеширования приходится в конфиге писать
 fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match if_not_empty;
 fastcgi_param HTTP_IF_MODIFIED_SINCE  $http_if_modified_since if_not_empty;

 И в результате выходят те же грабли, бекенд отвечает 304 статсом, если в
 кеше Nginx нет файлов, он сохраняет этот ответ в файл кеша.

 Вопрос остаётся открытым, как сделать клиенское (private) кеширования в
 браузере, но при этом не давать кешить 304 статус?

 Как вариант, можно при 304 ответе отправлять хедер X-Accel-Expires: 0, чтобы
 ответ не попал в кеш.

 Есть более красивые решения этой проблемы?

 Posted at Nginx Forum: 
 http://forum.nginx.org/read.php?21,245951,246004#msg-246004

 ___
 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

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Илья Шипицин
А какого рода динамический контент, можете привести пример? Желательно с
примером, когда помогает ревалидация.

суббота, 4 января 2014 г. пользователь S.A.N писал:

  а расскажите, о каких ресурсах идет речь ?
  если это js/css/картинка, ее всегда можно переименовать с хешем и
  добавить Cache-Control: max-age=очень-много

 Речь идет, о динамическом контенте, бекенд на РНР.
 Насчёт статичного контента, я с вами согласен, данный способ самый
 эффективный, мы так же делаем.

 Posted at Nginx Forum:
 http://forum.nginx.org/read.php?21,245951,246007#msg-246007

 ___
 nginx-ru mailing list
 nginx-ru@nginx.org javascript:;
 http://mailman.nginx.org/mailman/listinfo/nginx-ru
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

she admitted to a australian cardstock

2014-01-04 Пенетрантность pferforkersve1986
Brown held going all the way up until your dog was in Spooner's experience,
right in front on the Wizards' bench. Virtually. One is the actual charge so
that you can reintroduce guidelines to reduce medical malpractice claims and
cut the costs of defensive medicine  a move clearly opposed simply by trial
lawyers, a key constituency with regard to Democrats. 



I became young, plus stupid. Clarksdale is starting to look just like
Greenville, MS.If you can not like it, and then don't stay there. The
corneas, muscle tissue, cuboid and beautiful, unwrinkled pores and skin will
increase the quality of lifestyle for numerous others. Etc. 



I think it breaks up the bright field and also makes the unvarying look
uneven. But still, I enjoy Nice color of aqua, mixed in with a little
burgundy red on the edges. In law enforcement, you should protect your
mates and your friends as well.In. 



Comfortable, lovely and multipurpose, this gown is a musthave for your
wardrobe. (Obtain). Coutts says a bonspiel's future is definitely ultimately
going to need to be formed by the being different clubs as well as their
memberships. And i like an idea of Supporting they by doing a Recognition to
the Teams of New Orleans because Hornets is the Only workforce in New
Orleans that actually have knowledge of how to gain and could be the one
Professional Series in Brand new Orleans to give it it is really first ever
Great.. 



Perhaps, proposes Albert, we might be interested in some sort of paragliding
adventure?. Also, he caught Eighteen passes regarding 312 yards and 3
touchdowns. Since the 1920s the event sport regarding professional soccer
has had its hands strongly on the United states heartstrings and has become
the second eldest of American group sports just yielding its age to
specialist baseball.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246011,246011#msg-246011

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Модули по умолчанию

2014-01-04 Пенетрантность Илья Шипицин
Добрый день!

А не пробовали связываться с разработчика ми основных дистрибутивов, чтобы
прямо в дистрибутиве был правильный nginx с правильными модулями.

Мысль первая - когда патчил nginx до версии 1.4.4 (по причине выхода
обновления безопасности), на одном из серверов Ubuntu обновил через родной
убунтовский aptitude, прилетело 1.1.9, кажется.

Мысль вторая - в рассылке довольно частая ситуация, когда nginx падает в
core, начинается расследование, оказывается, что он собран с кучей не пойми
каких модулей, а у пользователя он оказался  из стандартного репозитория

воскресенье, 29 декабря 2013 г. пользователь Валентин Бартенев писал:

 On Sunday 29 December 2013 12:30:39 Алексей Сундуков wrote:
  [~]# uname -a
  Linux ww-realty.ru 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64
  GNU/Linux
  [~]# nginx -v
  nginx version: nginx/1.2.1
  [~]# nginx -V
  nginx version: nginx/1.2.1
  TLS SNI support enabled
  configure arguments: --prefix=/etc/nginx
 --conf-path=/etc/nginx/nginx.conf
  --error-log-path=/var/log/nginx/error.log
  --http-client-body-temp-path=/var/lib/nginx/body
  --http-fastcgi-temp-path=/var/lib/nginx/fastcgi
  --http-log-path=/var/log/nginx/access.log
  --http-proxy-temp-path=/var/lib/nginx/proxy
  --http-scgi-temp-path=/var/lib/nginx/scgi
  --http-uwsgi-temp-path=/var/lib/nginx/uwsgi
  --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid
  --with-pcre-jit --with-debug --with-http_addition_module
  --with-http_dav_module --with-http_geoip_module
  --with-http_gzip_static_module --with-http_image_filter_module
  --with-http_realip_module --with-http_stub_status_module
  --with-http_ssl_module --with-http_sub_module --with-http_xslt_module
  --with-ipv6 --with-sha1=/usr/include/openssl
  --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module
  --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-auth-pam
  --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-echo
  --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-upstream-fair
  --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-dav-ext-module
 

 На всякий случай прокомментирую.

 Это пакет из неофициального репозитория и к тому же устаревшей версии.
 Правильно nginx ставить отсюда: http://nginx.org/ru/linux_packages.html

 --
 Валентин Бартенев
 http://nginx.com/
 ___
 nginx-ru mailing list
 nginx-ru@nginx.org javascript:;
 http://mailman.nginx.org/mailman/listinfo/nginx-ru
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Daniel Podolsky
 Статистика показывает что залогиненые пользователи делают много повторных
 запросов на один uri, т.е там будет использоваться кеш браузера, для
 анонимных пользователей будет использоваться общий кеш Nginx который
 ревалидируется раз в две минуты.
Тогда возвращаемся к ответу Максима. Все - то есть, абсолютно -
параметры, от которых зависит или может зависеть ответ бекенда, должны
быть включены в ключ кеша. Не включать какие-либо из них в ключ - это
стрелять себе в ногу (и ваш пример в этом смысле - хрестоматийный).
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Илья Шипицин
блоги на каком движке написаны?

суббота, 4 января 2014 г. пользователь S.A.N писал:

  А какого рода динамический контент, можете привести пример? Желательно
  с
  примером, когда помогает ревалидация.

 Например, блоги наших клиентов, есть открытые публичные блоги есть закрытые
 приватные, в каждом блоге возможны комментарии посетителей. Спрогнозировать
 динамику изменений блога или новых комментариев сложно. По этому самое
 оптимальное решения, кешировать и динамические ревалидировать. Для
 анонимных
 гостей мы используем public, max-age=120, для залогиненых юзеров мы
 используем private, max-age=0, это означает кешить только в браузере и
 каждый запрос отправлять на сервер для ревалидации, кстати github.comделает
 так же private, max-age=0 и 304 статус если ETag актуальный.
 Статистика показывает что залогиненые пользователи делают много повторных
 запросов на один uri, т.е там будет использоваться кеш браузера, для
 анонимных пользователей будет использоваться общий кеш Nginx который
 ревалидируется раз в две минуты.

 Posted at Nginx Forum:
 http://forum.nginx.org/read.php?21,245951,246014#msg-246014

 ___
 nginx-ru mailing list
 nginx-ru@nginx.org javascript:;
 http://mailman.nginx.org/mailman/listinfo/nginx-ru
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Ксения Юрьевна Блащук
Добрый день.
Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
пересекающиеся диапазоны адресов. В документации:

A value of the most specific match is used. For example, for the 127.0.0.1
address the value RU will be chosen, not US.

Example with ranges:

geo $country {
ranges;
default   ZZ;
127.0.0.0-127.0.0.0   US;
127.0.0.1-127.0.0.1   RU;
127.0.0.1-127.0.0.255 US;
10.1.0.0-10.1.255.255 RU;
192.168.1.0-192.168.1.255 UK;
}

Пытаюсь воспроизвести этот пример:

/etc/init.d/nginx reload
 * Checking nginx' configuration ...
nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps 127.0.0.1-127.0.0.1
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps 127.0.0.1-127.0.0.1
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed

/etc/nginx/sites/test-geo.conf:
geo $country {
ranges;
default   ZZ;
127.0.0.0-127.0.0.0   US;
127.0.0.1-127.0.0.1   RU;
127.0.0.1-127.0.0.255 US;
10.1.0.0-10.1.255.255 RU;
192.168.1.0-192.168.1.255 UK;
}

 nginx -V
nginx version: nginx/1.4.4
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid
--lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include
--with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log
--http-client-body-temp-path=//var/lib/nginx/tmp/client
--http-proxy-temp-path=//var/lib/nginx/tmp/proxy
--http-fastcgi-temp-path=//var/lib/nginx/tmp/fastcgi
--http-scgi-temp-path=//var/lib/nginx/tmp/scgi
--http-uwsgi-temp-path=//var/lib/nginx/tmp/uwsgi --with-file-aio
--with-aio_module --with-pcre --with-pcre-jit
--without-http_empty_gif_module --without-http_fastcgi_module
--without-http_map_module --without-http_memcached_module
--without-http_scgi_module --without-http_split_clients_module
--without-http_uwsgi_module --with-http_addition_module
--with-http_image_filter_module --with-http_mp4_module
--with-http_realip_module --with-http_secure_link_module
--with-http_stub_status_module
--add-module=/var/tmp/portage/www-servers/nginx-1.4.4/work/headers-more-nginx-module-0.22
--add-module=/var/tmp/portage/www-servers/nginx-1.4.4/work/ngx-fancyindex-0.3.2
--without-mail_imap_module --without-mail_pop3_module
--without-mail_smtp_module --user=nginx --group=nginx

Gentoo Base System release 2.2
 uname -a
Linux 3.0.78 #1 SMP Mon May 20 15:17:58 FET 2013 x86_64 Intel(R) Xeon(R)
CPU E5310 @ 1.60GHz GenuineIntel GNU/Linux


В чем может быть дело?
Спасибо.
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность S.A.N
 Тогда возвращаемся к ответу Максима. Все - то есть, абсолютно -
 параметры, от которых зависит или может зависеть ответ бекенда,
 должны быть включены в ключ кеша.

Я не понимаю, как добавления в ключ кеша хедера if_none_match, может решить
проблему, автоматического удаления из запроса к бекенду клиент хедеров
if_none_match и if_modified_since, вы же понимаете чтобы работать с
клиентским кешем бекенду нужны клиентские заголовки if_none_match и
if_modified_since, но Nginx их удаляет, если в папке Nginx Кеша нет файла по
этому ключу, данного файла там никогда не будет, потому что этот uri всегда
генерируется с Cache-Control: private.
Да мы можем в конфиге прописать
fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match if_not_empty;
fastcgi_param HTTP_IF_MODIFIED_SINCE $http_if_modified_since if_not_empty;
но тогда мы получим кеширования страницы в 304 статусе, если в момент
запроса в папке кеша Nginx не будет файлов кеша по этому ключу, но браузер
выслал правильные и актуальные заголовки и получил от бекенда статус 304,
Nginx благополучно положит этот ответ в свой файл кеш. Вот в чем дело и ключ
Кеша здесь не причем.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,245951,246021#msg-246021

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Daniel Podolsky
2014/1/4 S.A.N nginx-fo...@nginx.us:
 Я не понимаю, как добавления в ключ кеша хедера if_none_match, может решить
 проблему,
Зато я, наконец, понял, о какой проблеме речь :)

О рассинхронизации клиентского кеша и кеша nginx. У клиентов файл в
кеше, в nginx кеше его нет - и мы имеем 304 закешированным (потому,
что специально разрешили кешировать 304).

А как ведет себя fastcgi_cache_valid 304 0; ?
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность S.A.N
 О рассинхронизации клиентского кеша и кеша nginx. У клиентов файл в
 кеше, в nginx кеше его нет - и мы имеем 304 закешированным (потому,
 что специально разрешили кешировать 304).
 
 А как ведет себя fastcgi_cache_valid 0s

Вот кофиг

fastcgi_cache cache;
fastcgi_cache_lock on;
fastcgi_cache_revalidate on;
fastcgi_cache_methods GET HEAD;
fastcgi_cache_valid 200 301 302 0s;
fastcgi_cache_key $host$uri$is_args$args;
fastcgi_cache_use_stale error updating http_503;

Деректива, fastcgi_cache_valid, не влияет если бекенд отдает заголовки
Cache-Control, потому что данные заголовки приоритетней деректив из конфига.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,245951,246024#msg-246024

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

toronto boss john gibbons states that

2014-01-04 Пенетрантность agstorenut1989
But if not really him the particular Fins really need to get one of the
additional 3 men.. Yet Adrienne claims she seasoned little difficulties
becoming Canadian.In She had assist where the idea mattered most  in a
classroom, at home. Eric Chavez click two homers and Nick Swisher along with
Russell Martin connected once each one next day Curtis Granderson hit about
three of the Yankees four homers within a 76 wow the Minnesota Twins what
100 years following Red Sox conquer the New york yankees forerunner, the
latest York Highlanders, Seventy-six in Eleven innings.



Now, with regards to the Cleveland Indians. The political election of Bob
Bullock last year will be the third phrase in a row by which Democrats get
held the actual governorship.. In a rounded about means, he shared with his
players to look at this flag, endure at attention and admire your region and
the those who do so very much for it.. 



Installed Memories works by using over 50,500 sq. Walt disney is producing
several projects specifically for the girl. The sizing chart may be used
creating the customized reversible nhl jerseys for the soccer team. He / she
loved the tight stop since her days from Florida, as well as friends told
him to discover what he / she could get for these people on craigslist and
ebay after listening to that quite a few jerseys had been going for lots of
money. 



The face mask on the lid was glowing blue from 1974 through 1986 before
changing to be able to white. That will get you a full, as brand-new rebuilt
equipment, looking plus performing identically to after they first mailed
that machine out of the manufacturing unit.. Fisk won the AL Silver Glove at
Catcher and the AL Rookie of the Year awards which year.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246025,246025#msg-246025

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

a ex - bike courier service from lake oswego

2014-01-04 Пенетрантность soaversrasom1977
By Seven o'clock, urbanites giddy within the sight regarding ripe tomato
vegetables are crowding and ready to obtain. Union Rectangle Greenmarket is
the main farmers market in the location. At this junction of several subway
lines are colorful simple guidelines of out of the way bounty: red-colored
peppers, violet eggplants, and older squash. Frostblue Rapport grapes
project their scent. 



You must be registered to opinion (your brief review will be saved for you
while you register). It can be quick (it takes about 30 seconds) and then we
only require your email as well as name. Feedback that include almost any
offensive materials are restricted. By using our site you accept our
comparison to its use.  This North western city, featuring a landscape, the
culture, its people and it is pitfalls, is a living, breathing character
with AMC's Breaking Bad.In . When the remaining eight instances of
Breaking Bad' get ongoing Aug. 12, many followers will experience a painful
withdrawal at a drama that is become evermore hard to kick since the 2008
first appearance. Of course, a town is only just as real as what's inside
their borders. Here's six accounts behind reallife spots of Breaking Bad.
Full Story



If walking the boardwalk gets weary, hire a rolling chair  reminiscent of
your rickshaw and sent by a man or woman. As long lasting as the moving
chair history is the stage to which you're going to be hassled to hire a
single: you'll be neared nonstop to help takes tours, no matter where that
you are on the boardwalk. Rates vary from a few bucks to well over $20
depending on the yardage and the retailer. However that you are getting
around, solid a inquiring glance at the Nadine Boggs Father Pavilion,
between New york city and Ky Avenues: is it doesn't site of the future
Atlantic Town Boardwalk Holocaust Memorial, the actual winning model for
which will likely be selected in late September.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246026,246026#msg-246026

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

but it is a excellent notion to check out what is out there regionally since nicely

2014-01-04 Пенетрантность flusondini1984
For those OK with the mainstream, Whitened River Woodland welcomes above 10
million readers a year, which makes it the mostvisited excitement forest in
the nation. But don't don't like it to be beautiful; it has substance, very.
The natrual enviroment boasts Seven wilderness spots, 2,400 miles connected
with trail, 1,900 distance of turning service method roads, and also 12
snowboard resorts (should your snow shredders fit the spine space). 



Throughout 1974, this standing bison logo seemed to be replaced by the blue
charging you one with a red slanting stripe surging from its horn. Back in
1984, the helmet's track record color seemed to be changed by white for you
to red, supposedly in part to distinguish them far more readily via three of
their total division competitors at that time, the particular Indianapolis
Colts, the particular Miami Fish, and the New England Patriots, who just
about all also was wearing white headwear at that point. In that case in
2008, a richer shade connected with blue as well as nickel were being
introduced, along with red and white conduit trimming on the Buffalo Bills
jerseys and pants. The original shades connected with red and blue, on the
other hand, were contained as striping colorations. They are also even now
used on their logos.



A Panthers players want it. The followers like it.Now there absolutely no
way that it's a better homogeneous than a lot of the NFL most triedandtrue
combos, however, like the types Pittsburgh, Green Bay, Dallas, Oregon and
Contra costa wear, as an example. Those blackonblack outfits just getaway
been through sufficient wars.At the same time, though, consider this a
request for more blackonblack for your Panthers. Even if the Monitor gets
his or her way they usually don earn...

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246029,246029#msg-246029

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

there was no mistaking the swing

2014-01-04 Пенетрантность tracresmexo1987
Calendar year changes include gray slacks, and a metal silver/gray helmet,
much like those utilized by the Ohio State Buckeyes, as well as grey accents
around letters, quantities and piping along the back and torso portions of
the particular jerseys. Elevated as an American in Virginia Beach. 



The group was presented singing for hits by means of Will Jackson (Wild Wid
West from Smith's film of the same title), Foxy Brown (Awful Mama Jamma,
which will interpolated Carl Carlton's sonamed hit on the early Eighties
era), and Mariah Carey (The Wonderful Ones, a rebuilding of Prince's hit
from 1984's Violet Rain). 



Very, bad for farmville that they really don't wear the helmet while using
TriCorn emblem since they did their own first year.. They may have looked
much stronger, and they are rolling over.. Also you can get no cost latitude
and longitude coordinates in the topographical map and hang up your Gps
unit. 



Recently, she teamed up together with Project Runway designer Kenley
Collins to produce a gift established featuring a chiffon headband and a
complementing scarlet lipstick. That explains precisely why Notre Dame
routinely former pupils 100% and almost that same quantity go on to
universities and colleges.I think, not any I know, that most the pessimism
expressed below and other areas about Notre Dame will be rooted with
jealousy in addition to guilt. 



Demonstrate the kid some respect. That isn't what this is certainly about,
due to the fact I'm likewise offended  esthetically, I'm talking about  by
the Indians program on the chest of the typical home jerseys. Email via
Kara(ph): I am going to fondly try to remember Tom Keith, your longtime
sound clips man with regard to Minnesota Open Radio's A Prairie Home
Associate. They gave many people the gift associated with laughter every
week.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246031,246031#msg-246031

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность Andrey Kopeyko

02.01.2014 07:37, S.A.N пишет:

Заметили очень неприятный баг, в результате которого, клиенты получали
пустую страницу.


Добрый день!



fastcgi_cache_key $host$uri$is_args$args;


Это ни разу ни баг - это вы недонастроили.

Добавьте в ключ кеширования параметр
  $http_if_modified_since
и наступит вам счастье.

Для понимания происходящего рекомендую прочитать
  http://dklab.ru/chicken/nablas/56.html



--
Best regards,
Andrey Kopeyko and...@kopeyko.ru

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Ксения Юрьевна Блащук
Да, спасибо, все так, но очень смутил пример в документации по модулю.
Hello!

On Sat, Jan 04, 2014 at 06:12:25PM +0400, Валентин Бартенев wrote:

 On Saturday 04 January 2014 15:01:16 Ксения Юрьевна Блащук wrote:
  Добрый день.
  Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
  пересекающиеся диапазоны адресов. В документации:
 
  A value of the most specific match is used. For example, for the
127.0.0.1
  address the value RU will be chosen, not US.
 
  Example with ranges:
 
  geo $country {
  ranges;
  default   ZZ;
  127.0.0.0-127.0.0.0   US;
  127.0.0.1-127.0.0.1   RU;
  127.0.0.1-127.0.0.255 US;
  10.1.0.0-10.1.255.255 RU;
  192.168.1.0-192.168.1.255 UK;
  }
 
  Пытаюсь воспроизвести этот пример:
 
  /etc/init.d/nginx reload
   * Checking nginx' configuration ...
  nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
127.0.0.1-127.0.0.1
  in /etc/nginx/sites/test-geo.conf:6
  nginx: configuration file /etc/nginx/nginx.conf test failed
  nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
127.0.0.1-127.0.0.1
  in /etc/nginx/sites/test-geo.conf:6
  nginx: configuration file /etc/nginx/nginx.conf test failed
 
 [..]
 
  В чем может быть дело?
  Спасибо.

 Это баг в проверке конфигурации.

 Чтобы его обойти можете поменять местами так чтобы вначале шел больший
 диапазон:

 127.0.0.1-127.0.0.255 US;
 127.0.0.1-127.0.0.1   RU;

Это не баг, это фича.  Код не умеет обрабатывать добавления
диапазонов, перекрывающих уже существующие диапазоны, и честно об
этом сообщает.

При использовании range'ей последующими строками можно
переопределить часть ранее заданного диапазона адресов.  Задать
диапазон, который бы включал в себя ранее заданные диапазоны -
нельзя.

--
Maxim Dounin
http://nginx.org/

___
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

Re: ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Maxim Dounin
Hello!

On Sat, Jan 04, 2014 at 09:17:00PM +0300, Ксения Юрьевна Блащук wrote:

 Да, спасибо, все так, но очень смутил пример в документации по модулю.

Ну он неправильный, так иногда бывает. :)
Правильный, кстати, есть тут:

http://nginx.org/ru/docs/http/ngx_http_geo_module.html#geo

-- 
Maxim Dounin
http://nginx.org/

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Валентин Бартенев
On Saturday 04 January 2014 22:09:29 Maxim Dounin wrote:
 Hello!
 
 On Sat, Jan 04, 2014 at 06:12:25PM +0400, Валентин Бартенев wrote:
  On Saturday 04 January 2014 15:01:16 Ксения Юрьевна Блащук wrote:
   Добрый день.
   Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
   пересекающиеся диапазоны адресов. В документации:
   
   A value of the most specific match is used. For example, for the
   127.0.0.1
   address the value RU will be chosen, not US.
   
   Example with ranges:
   
   geo $country {
   
   ranges;
   default   ZZ;
   127.0.0.0-127.0.0.0   US;
   127.0.0.1-127.0.0.1   RU;
   127.0.0.1-127.0.0.255 US;
   10.1.0.0-10.1.255.255 RU;
   192.168.1.0-192.168.1.255 UK;
   
   }
   
   Пытаюсь воспроизвести этот пример:
   
   /etc/init.d/nginx reload
   
* Checking nginx' configuration ...
   
   nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
   127.0.0.1-127.0.0.1
   in /etc/nginx/sites/test-geo.conf:6
   nginx: configuration file /etc/nginx/nginx.conf test failed
   nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
   127.0.0.1-127.0.0.1
   in /etc/nginx/sites/test-geo.conf:6
   nginx: configuration file /etc/nginx/nginx.conf test failed
  
  [..]
  
   В чем может быть дело?
   Спасибо.
  
  Это баг в проверке конфигурации.
  
  Чтобы его обойти можете поменять местами так чтобы вначале шел больший
  
  диапазон:
  127.0.0.1-127.0.0.255 US;
  127.0.0.1-127.0.0.1   RU;
 
 Это не баг, это фича.  Код не умеет обрабатывать добавления
 диапазонов, перекрывающих уже существующие диапазоны, и честно об
 этом сообщает.
 
 При использовании range'ей последующими строками можно
 переопределить часть ранее заданного диапазона адресов.  Задать
 диапазон, который бы включал в себя ранее заданные диапазоны -
 нельзя.

Фича, как известно, это задокументированная бага, а в данном же случае
было не так. =)

Можно и научить:

diff -r b1db6dda3f83 src/http/modules/ngx_http_geo_module.c
--- a/src/http/modules/ngx_http_geo_module.cSat Jan 04 18:48:25 2014 +0400
+++ b/src/http/modules/ngx_http_geo_module.cSat Jan 04 22:48:11 2014 +0400
@@ -798,10 +798,22 @@ ngx_http_geo_add_range(ngx_conf_t *cf, n
 
 i--;
 
+if (s  (ngx_uint_t) range[i].start
+ e == (ngx_uint_t) range[i].end)
+{
+e = range[i].start - 1;
+}
+
 if (e  (ngx_uint_t) range[i].start) {
 continue;
 }
 
+if (s == (ngx_uint_t) range[i].start
+ e  (ngx_uint_t) range[i].end)
+{
+s = range[i].end + 1;
+}
+
 if (s  (ngx_uint_t) range[i].end) {
 
 /* add after the range */
@@ -835,6 +847,30 @@ ngx_http_geo_add_range(ngx_conf_t *cf, n
 goto next;
 }
 
+if (s  (ngx_uint_t) range[i].start
+ e  (ngx_uint_t) range[i].end)
+{
+/* split the new range and insert a fragment after */
+
+range = ngx_array_push(a);
+if (range == NULL) {
+return NGX_CONF_ERROR;
+}
+
+range = a-elts;
+
+ngx_memmove(range[i + 2], range[i + 1],
+   (a-nelts - 2 - i) * sizeof(ngx_http_geo_range_t));
+
+range[i + 1].start = range[i].end + 1;
+range[i + 1].end = (u_short) e;
+range[i + 1].value = ctx-value;
+
+e = range[i].start - 1;
+
+continue;
+}
+
 if (s  (ngx_uint_t) range[i].start
  e  (ngx_uint_t) range[i].end)
 {


Хотя проще видимо задокументировать.

--
Валентин Бартенев
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Igor Sysoev
04.01.2014, в 23:03, Валентин Бартенев vb...@nginx.com написал(а):

 On Saturday 04 January 2014 22:09:29 Maxim Dounin wrote:
 Hello!
 
 On Sat, Jan 04, 2014 at 06:12:25PM +0400, Валентин Бартенев wrote:
 On Saturday 04 January 2014 15:01:16 Ксения Юрьевна Блащук wrote:
 Добрый день.
 Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
 пересекающиеся диапазоны адресов. В документации:
 
 A value of the most specific match is used. For example, for the
 127.0.0.1
 address the value RU will be chosen, not US.
 
 Example with ranges:
 
 geo $country {
 
ranges;
default   ZZ;
127.0.0.0-127.0.0.0   US;
127.0.0.1-127.0.0.1   RU;
127.0.0.1-127.0.0.255 US;
10.1.0.0-10.1.255.255 RU;
192.168.1.0-192.168.1.255 UK;
 
 }
 
 Пытаюсь воспроизвести этот пример:
 
 /etc/init.d/nginx reload
 
 * Checking nginx' configuration ...
 
 nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
 127.0.0.1-127.0.0.1
 in /etc/nginx/sites/test-geo.conf:6
 nginx: configuration file /etc/nginx/nginx.conf test failed
 nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
 127.0.0.1-127.0.0.1
 in /etc/nginx/sites/test-geo.conf:6
 nginx: configuration file /etc/nginx/nginx.conf test failed
 
 [..]
 
 В чем может быть дело?
 Спасибо.
 
 Это баг в проверке конфигурации.
 
 Чтобы его обойти можете поменять местами так чтобы вначале шел больший
 
 диапазон:
127.0.0.1-127.0.0.255 US;
127.0.0.1-127.0.0.1   RU;
 
 Это не баг, это фича.  Код не умеет обрабатывать добавления
 диапазонов, перекрывающих уже существующие диапазоны, и честно об
 этом сообщает.
 
 При использовании range'ей последующими строками можно
 переопределить часть ранее заданного диапазона адресов.  Задать
 диапазон, который бы включал в себя ранее заданные диапазоны -
 нельзя.
 
 Фича, как известно, это задокументированная бага, а в данном же случае
 было не так. =)
 
 Можно и научить:

Нет, учить не надо. Изначально предполагался контроль данных с возможностью 
последующего оверрайда некоторых диапазонов.


-- 
Igor Sysoev
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Bug – 304 status - Cache-Control

2014-01-04 Пенетрантность S.A.N
 блоги на каком движке написаны?

Блоги - это один из модулей, нашего самописного фреймворка.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,245951,246034#msg-246034

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: ngx_http_geo_module range overlaps

2014-01-04 Пенетрантность Maxim Dounin
Hello!

On Sat, Jan 04, 2014 at 11:03:04PM +0400, Валентин Бартенев wrote:

 On Saturday 04 January 2014 22:09:29 Maxim Dounin wrote:
  Hello!
  
  On Sat, Jan 04, 2014 at 06:12:25PM +0400, Валентин Бартенев wrote:
   On Saturday 04 January 2014 15:01:16 Ксения Юрьевна Блащук wrote:
Добрый день.
Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
пересекающиеся диапазоны адресов. В документации:

A value of the most specific match is used. For example, for the
127.0.0.1
address the value RU will be chosen, not US.

Example with ranges:

geo $country {

ranges;
default   ZZ;
127.0.0.0-127.0.0.0   US;
127.0.0.1-127.0.0.1   RU;
127.0.0.1-127.0.0.255 US;
10.1.0.0-10.1.255.255 RU;
192.168.1.0-192.168.1.255 UK;

}

Пытаюсь воспроизвести этот пример:

/etc/init.d/nginx reload

 * Checking nginx' configuration ...

nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
127.0.0.1-127.0.0.1
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] range 127.0.0.1-127.0.0.255 overlaps
127.0.0.1-127.0.0.1
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed
   
   [..]
   
В чем может быть дело?
Спасибо.
   
   Это баг в проверке конфигурации.
   
   Чтобы его обойти можете поменять местами так чтобы вначале шел больший
   
   диапазон:
   127.0.0.1-127.0.0.255 US;
   127.0.0.1-127.0.0.1   RU;
  
  Это не баг, это фича.  Код не умеет обрабатывать добавления
  диапазонов, перекрывающих уже существующие диапазоны, и честно об
  этом сообщает.
  
  При использовании range'ей последующими строками можно
  переопределить часть ранее заданного диапазона адресов.  Задать
  диапазон, который бы включал в себя ранее заданные диапазоны -
  нельзя.
 
 Фича, как известно, это задокументированная бага, а в данном же случае
 было не так. =)

В данном случае это не бага, да.  :)

 Можно и научить:

[...]

Так - будет неправильно, т.к. в результате ты не знаешь, какой 
диапазон более специфичен.  Пример:

   127.0.0.1-127.0.0.2  US;
   127.0.0.1-127.0.0.3  RU;
   127.0.0.3-127.0.0.4  UA;

Для 127.0.0.3 должен быть результат UA (т.к. диапазон 
127.0.0.3-127.0.0.4 наиболее специфичен), с твоим же патчем 
получается RU.

Ну и в целом по вопросу Игорь уже высказался.

-- 
Maxim Dounin
http://nginx.org/

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

SSL Ошибка

2014-01-04 Пенетрантность mishatatinets
Я пытаюсь установить сертификат, но мне при тестировании выкидывает
следующую ошибку. 

nginx: [emerg] BIO_new_file(/etc/nginx/certificates/domain.crt) failed
(SSL: error:02001002:system library:fopen:No such file or
directory:fopen('/etc/nginx/certificates/domain.crt','r') error:2006D080:BIO
routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

Что может быть с этим и как это поправить? Надеюсь кто нибудь  знает что с
этим делать, а то я нигде немогу найти ответа.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,246036,246036#msg-246036

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru