Welcome! Log In Create A New Profile


nginx as front end cache for WMS

March 03, 2014 05:26PM
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/nginx.pid;

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.

Subject Author Posted

nginx as front end cache for WMS

tt5430 March 03, 2014 05:26PM

Re: nginx as front end cache for WMS

Anton Yuzhaninov March 04, 2014 05:24AM

Re: nginx as front end cache for WMS

tt5430 March 04, 2014 07:34PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready