2
모든 폴더에서 다음과 동일한 설정을 유지하고 싶습니다. 폴더/wp-admin에서 add_header Cache-Control "no-store";
설정은 .php 파일의 경우 만 추가해야합니다.Nginx를 사용하여 단일 폴더에 특정 헤더를 설정하는 방법은 무엇입니까?
질문 :
Nginx의 특정 폴더에서만 설정을 변경하는 방법은 무엇입니까?
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
add_header Cache-Control "public";
access_log off;
}
location [IF PHP FILE IN wp-admin FOLDER] {
add_header Cache-Control "no-store";
}
location ~* \.(js|css|svg|png|jpg|jpeg|gif|ico|eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public";
access_log off;
log_not_found off;
expires 1y;
}
신난다, 고마워. –