浏览 3.6k
Cache-Control设置了max-age没有覆盖no-cache,no-store,响应头出现三个Cahce-control


按点赞数排序
按时间排序
请提供详细配置信息。
location / {
add_header Cache-Control max-age=2592000;
root html;
index index.html index.htm;
}
我使用如上配置,服务端响应如下:
HTTP/1.1 200 OK
Server: nginx/1.20.2
Date: Fri, 02 Sep 2022 09:10:55 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Wed, 20 Jul 2022 12:09:37 GMT
Connection: keep-alive
ETag: "62d7f081-264"
Cache-Control: max-age=2592000
Accept-Ranges: bytes
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
0
回答于2022-10-25 15:25
worker_processes 是用来设置worker进程数量的,auto只是根据CPU核心数来配置worker进程数,它与sched_setaffinity调用,也就是CPU亲和性无关。应该是你的 worker_cpu_affinity指令配错了,你改成worker_cpu_affinity auto;看看。
try_files file ... =404; 可以指定找不到时,返回的消息码。 默认不指定找不到的话,会以最后的参数从新location 从定向。
微信公众号
加入微信群