nginx as front end cache for WMS

tt5430 nginx-forum at
Mon Mar 3 22:26:55 UTC 2014

I tried to set up nginx as a front end cache for my WMS server.  The typical
WMS request is:
Below is my nginx configuration:

user vriuser;
worker_processes 4;
pid /var/run/;

events {
        worker_connections 768;
        # multi_accept on;

http {
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        include /etc/nginx/mime.types;
        default_type application/octet-stream;

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

        proxy_buffering           on;
        proxy_cache_valid         any 10m;
        proxy_cache_path          /var/geoserver/cache  levels=1:2
keys_zone=one:10m inactive=7d max_size=5000m;
        proxy_temp_path           /var/geoserver/cache/tmp;

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        gzip on;
        gzip_disable "msie6";

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;

server {
        listen       80;
        #server_name  localhost;
        root         /home/geoserver/webapps/geoserver;

        location /geoserver {
            proxy_pass   http://localhost:8080;
            proxy_cache             one;
            proxy_cache_key         backend$request_uri;
            proxy_cache_valid       200  5h;
            proxy_cache_use_stale   error timeout invalid_header;

Both nginx and my WMS servers were running without errror.  However, when I
inspect the /var/geoserver/cache directory, I did not see anything file in
there.  Does it mean my configuration is not correct?  How do I know if
nginx caches my WMS responses?  Any help on this is greatly appreciated.

Many thanks in advance.


Posted at Nginx Forum:,248053,248053#msg-248053

More information about the nginx mailing list