Ryan M. Wrote:
logged-in user requests should never be in cache
http://mine.example.com/foo ← logmein is
In this case, there would not be a cache hit on
going to have problems.
–
RPM
nginx mailing list
[email protected]
nginx Info Page
The app sets “Cache-Control: private” right now for everyone, and with
the following setup even users that are not logged in receive a fresh
copy of the page every time. The said cookie is set when logging in to
the domain xyz.com(not actual domain) as well as other cookies but when
using the nginx proxy only the other cookies are set and the logmein
cookie isn’t visible.
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local]
“$request” ’
# '$status $body_bytes_sent “$http_referer” ’
# ‘“$http_user_agent” “$http_x_forwarded_for”’;
#access_log logs/access.log main;
client_body_buffer_size 128K;
client_header_buffer_size 128K;
client_max_body_size 1M;
large_client_header_buffers 1 1k;
client_body_timeout 60;
client_header_timeout 60;
keepalive_timeout 60 60;
send_timeout 60;
ignore_invalid_headers on;
keepalive_requests 100;
limit_zone gulag $binary_remote_addr 5m;
recursive_error_pages on;
sendfile on;
server_name_in_redirect off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_types text/plain text/css image/x-icon application/x-perl
application/x-httpd-cgi;
gzip_vary on;
proxy_buffering on;
proxy_cache_path /optimum/nginx/cache levels=1:2
keys_zone=my-cache:8m max_size=1000m inactive=600m;
proxy_temp_path /optimum/nginx/cache/tmp;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_cache_valid any 10m;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://xyz.com;
proxy_cache my-cache;
proxy_pass_header Set-Cookie;
proxy_cache_key $host$request_uri$http_cookie_logmein;
proxy_cache_valid 404 1m;
index index.php index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
Posted at Nginx Forum: