Welcome! Log In Create A New Profile

Advanced

nginx + memcached + gzip

September 04, 2014 10:39AM
Hello.

I have service with memcached for storing large xml data. Data is compressed in memcached. I want to send responce gzipped if client supports that and decompressed if not. But with my config responce goes to client always decompressed. There is my site config:

server {
listen 80;
server_name static.app1.feeds.lan;

location / {
memcached_pass 10.10.0.11:11211;
gunzip on;
memcached_gzip_flag 2;
gzip_static on;
gzip on;
gzip_proxied any;
gzip_types "text/xml";
gzip_vary on;

set $memcached_key "null";
if ($uri ~* "/uploads/(.*)/feed.xml") {
set $memcached_key $1;
}
}
}

and nginx config:

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 16384;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
...


Thanks!
Subject Author Posted

nginx + memcached + gzip

LinU777 September 04, 2014 10:39AM

Re: nginx + memcached + gzip

LinU777 September 04, 2014 10:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
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