worker_processes 4;
events { worker_connections 1024; }
http {
proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:30m max_size=1G;
upstream app_upstream {
server localhost:3001;
}
server {
listen 80;
location ~* \.io {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://app_upstream;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /static {
proxy_cache cache;
proxy_cache_valid 30m;
proxy_pass http://app_upstream;
}
location / {
proxy_cache cache;
proxy_cache_valid 30m;
add_header X-Cache-Status $upstream_cache_status;
proxy_pass http://app_upstream;
}
}
}
沒有留言:
張貼留言