Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:




, "session" ? . .
9 2010 . 15:00 Igor Sysoev <igor@xxxxxxxxx> :
On Wed, Jun 09, 2010 at 02:42:48PM +0300, Alex Smorodin wrote:

> ( 0.7.66 0.8.4):
> location / {
> proxy_pass http://192.168.0.32:81;
> proxy_set_header Host domain.com;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_next_upstream error timeout invalid_header http_500 http_503;
> proxy_cache one;
> proxy_no_cache $cookie_session;
> proxy_cache_key
> "$request_method|$is_args|$host|$request_uri|$cookie_session";

$is_args ?
$request_method ? HEAD ?

> proxy_hide_header Set-Cookie;
> proxy_pass_header Set-Cookie;
> proxy_ignore_headers "Cache-Control" "Expires";
> proxy_cache_valid 200 301 302 304 1h;
> }
> location ~ (^/(page1|page2)) {
> proxy_pass http://192.168.0.32:81;
> proxy_set_header Host domain.com;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_next_upstream error timeout invalid_header http_500 http_503;
> proxy_cache off;
> }
> proxy_hide_headers Set-Cookie - session
> , ( ).
> proxy_path_header Set-Cookie - ,
> .
> , ,
> . .
> session .
> "Set-Cookie: SESSION=c6070942bd95129dff2f34271169a226
> no_cache $cookie_session
> .

$cookie_session - , Set-Cookie.

, .
-
proxy_hide_header/proxy_pass_header
.

, ,
?

> 7 2010 . 16:01 Igor Sysoev <igor@xxxxxxxxx> :
>
> > On Mon, Jun 07, 2010 at 03:06:54PM +0300, Alex Smorodin wrote:
> >
> > > . ubuntu 2.6.27-11-generic,nginx version: nginx/
> > 0.7.65.
> > > nginx. post
> > ,
> > > session, c,
> > > , .
> > :
> > > ,
> > > "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;".
> > > , . ,
> > ?
> > > proxy_cache_key session,
> > > ( ).
> > > :
> > > server {
> > > listen 192.168.0.32:9081;
> > > server_name domain.com;
> > > access_log /var/log/nginx/domain.com/nginx-access.log combined;
> > > error_log /var/log/nginx/domain.com/nginx-error.log error;
> > > proxy_temp_path /var/cache/nginx/domain.com;
> > > location @nocached {
> > > proxy_pass http://192.168.0.32:81;<
> > http://192.168.0.32:81/;>
> > > proxy_set_header Host domain.com;
> > > proxy_set_header X-Real-IP $remote_addr;
> > > proxy_set_header X-Forwarded-For
> > $proxy_add_x_forwarded_for;
> > > }
> > > location / {
> > > proxy_pass http://192.168.0.32:81;<
> > http://192.168.0.32:81/;>
> > > proxy_set_header Host domain.com;
> > > proxy_set_header X-Real-IP $remote_addr;
> > > proxy_set_header X-Forwarded-For
> > $proxy_add_x_forwarded_for;
> > > proxy_next_upstream error timeout invalid_header http_500
> > > http_503;
> > > if ($cookie_session) {
> > > return 412;
> > > }
> > > if ($request_method = POST ) {
> > > return 412;
> > > }
> > > error_page 412 = @nocached;
> > > proxy_cache one;
> > > proxy_cache_key
> > > "$request_method|$is_args|$host|$request_uri|$cookie_session";
> > > proxy_hide_header "Set-Cookie";
> > > proxy_ignore_headers "Cache-Control" "Expires";
> > > proxy_cache_valid 200 301 302 304 1h;
> > > }
> > > }
> >
> > 0.8.40 :
> >
> > server {
> > listen 192.168.0.32:9081;
> > server_name domain.com;
> > access_log /var/log/nginx/domain.com/nginx-access.log combined;
> > error_log /var/log/nginx/domain.com/nginx-error.log error;
> > proxy_temp_path /var/cache/nginx/domain.com;
> >
> > location / {
> > proxy_pass http://192.168.0.32:81;
> > proxy_set_header Host domain.com;
> > proxy_set_header X-Real-IP $remote_addr;
> > proxy_next_upstream error timeout invalid_header http_500
> > http_503;
> > proxy_cache one;
> > proxy_no_cache $cookie_session;
> > proxy_cache_key domain.com$uri?$args;
> > proxy_hide_header "Set-Cookie";
> > proxy_ignore_headers "Cache-Control" "Expires";
> > proxy_cache_valid 200 301 302 304 1h;
> > }
> > }
> >
> >
> > --
> >
> > http://sysoev.ru
> >
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru@xxxxxxxxx
> > http://nginx.org/mailman/listinfo/nginx-ru
> >
>
>
>
> --
> ,
>
>
> mailto: agsmorodin@xxxxxxxxx

> _______________________________________________
> nginx-ru mailing list
> nginx-ru@xxxxxxxxx
> http://nginx.org/mailman/listinfo/nginx-ru


--

http://sysoev.ru

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



--
,


mailto: agsmorodin@xxxxxxxxx
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru

  • Follow-Ups:
    • Re:
      • From: Igor Sysoev
  • References:
      • From: Alex Smorodin
    • Re:
      • From: Igor Sysoev
    • Re:
      • From: Alex Smorodin
    • Re:
      • From: Igor Sysoev

 




Copyright © Lexa Software, 1996-2009.