【发布时间】:2023-02-03 15:30:30
【问题描述】:
Nginx 在缓存请求时会考虑除 url 之外的哪些属性(headers,cookies)?
我试图在nginx/日志/access.log文件。我只找到了有关发出的请求类型 (GET) 及其状态(404、200 等)的信息。
这是我的nginx 配置文件文件:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
# MY TEST SERVER
http {
# CACHE
proxy_cache_path "C:\data\cache" levels=1:2 keys_zone=all:32m;
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:81/;
proxy_cache all;
proxy_cache_valid 404 502 503 1s;
proxy_cache_valid any 10s;
}
server {
listen 81;
location / {
root "C:\data\www";
}
location /images/ {
root "C:\data";
}
}
}
【问题讨论】:
标签: nginx caching nginx-cache