当我尝试净化时评估Nginx Plus,我得到了405不允许。我已按照说明进行操作,但不确定丢失了什么。下面是我的设置
docker run --rm -p 8001:80 --link node-app-local:app --name nginx-proxy-local foo/nginx-nginxplus
curl -X PURGE -D – "http://tktestapp:8001/*"
nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $upstream_cache_status';
log_format nginx '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent $request_time '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log nginx;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
map $request_method $purge_method {
PURGE 1;
default 0;
}
include /etc/nginx/conf.d/*.conf;
}
conf.d / caching.conf
proxy_cache_path /data/nginx/cache keys_zone=nodejs_app:10m;
proxy_cache nodejs_app;
proxy_cache_valid 200 10m;
proxy_cache_purge $purge_method;
conf.d / nodejsapp.conf
server {
server_name tktestapp;
status_zone tktestzone;
location /test {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto $scheme;
proxy_pass http://app:3000;
add_header X-GG-Cache-Status $upstream_cache_status;
}
}