用于用户authenticationWeb应用程序的nginx代理cachingconfiguration

我有一个在节点+ express + passport + mongo数据库+ ejs的web应用程序,单个应用程序configuration为处理所有的子域。 我使用nginx作为代理服务器,我需要并且必须使用代理caching来减less节点服务器上的负载。

我有2个问题,

1.我需要configurationnginx代理caching,因为它应该为各个子域创build不同的caching。

2.对于login的用户内容会改变一点点。 我怎么能pipe理这个..?

请帮我解决。

提前致谢。

以下是configuration

upstream backend_app_hosts { server localhost:3005 max_fails=0 fail_timeout=10s; server localhost:3006 max_fails=0 fail_timeout=10s; keepalive 64; } proxy_cache_path /var/www/cache levels=1:2 keys_zone=cache-1:8m max_size=1000m inactive=600m; server { listen 80 ; charset UTF-8; client_max_body_size 16M; keepalive_timeout 20; server_name *.domain.com; location / { proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header Connection ""; proxy_http_version 1.1; proxy_pass http://backend_app_hosts/; proxy_cache cache-1; proxy_cache_valid 200 302 1440m; proxy_cache_valid 404 1m; } }