프런트 엔드 캐시 서버로 Ngnix 서버가 있는데 특정 URL에서 캐시를 사용하지 않으려합니다. 여기 speicfic url을 캐시하지 않도록 Ngnix를 구성하는 방법은 무엇입니까?
는 Nginx에의 구성입니다proxy_cache_path /tmp/nginx levels=1:2 keys_zone=my_zone:10m inactive=120m max_size=1000m;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
server {
listen 10.0.0.45:80 default_server;
server_name proxy2.jjd;
include /etc/nginx/default.d/*.conf;
location/{
client_max_body_size 20m;
proxy_cache my_zone;
proxy_cache_bypass $http_cache_control;
add_header X-Proxy-Cache-NGINX $upstream_cache_status;
proxy_no_cache $http_pragma $http_authorization $cookie_nocache $arg_nocache;
add_header X-Real-IP $remote_addr;
add_header Cache-Control "public";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 90;
proxy_connect_timeout 90;
proxy_redirect off;
}
}
nginx 설정을 제공해야하지만 보통 'proxy_cache_bypass' 지시자가 필요합니다. –
안녕하세요. 질문을 업데이트했습니다. 나 좀 도와 줄 수있어? – user3796291