server {
server_name _;
return 302 https://infoteka.pw$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /srv/infoteka.pw;
server_name infoteka.pw;
...
upstream php {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
return 301 https://infoteka.pw$request_uri;
include conf.d/ssl.conf;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /srv/infoteka.pw;
server_name infoteka.pw;
index index.php index.html index.htm;
set $root_path /srv/infoteka.pw;
set $cache_uri $request_uri;
set $skip_cache 0;
set $cache_control 'public, store, must-revalidate';
set $expires 24h;
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
###No Cache###
rewrite ^/favicon.png$ /favicon.ico last;
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_buffers 4 512k;
fastcgi_busy_buffers_size 512k;
fastcgi_temp_file_write_size 512k;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_cache WORDPRESS;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache_valid 200 60m;
fastcgi_cache_lock on;
client_max_body_size 5M;
add_header X-FastCGI-Cache $upstream_cache_status;
if (!-f $realpath_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
}
}
location ~ /.well-known {
allow all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all; # запрет для скрытых файлов
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all; # запрет для загруженных скриптов
}
include conf.d/ssl.conf;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
charset off;
error_page 403 = 404;
keepalive_timeout 20 20;
###WORDPRESS###
set $cache_uri $request_uri;
if ($request_method = POST) {
set $cache_uri 'null cache';
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://infoteka.pw$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /srv/infoteka.pw;
server_name infoteka.pw;
...
server {
server_name www.infoteka.pw;
return 301 $scheme://infoteka.pw$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name infoteka.pw www.infoteka.pw;
return 301 https://infoteka.pw$request_uri;
location ~ /.well-known {
allow all;
}
}
server {
listen 443 ssl default_server http2;
listen [::]:443 ssl default_server http2;
root /srv/infoteka.pw;
server_name infoteka.pw;
...
server {
listen 80;
listen [::]:80;
server_name infoteka.pw;
return 301 https://infoteka.pw$request_uri;
location ~ /.well-known {
allow all;
}
}
server {
listen 443 ssl default_server http2;
listen [::]:443 ssl default_server http2;
root /srv/infoteka.pw;
server_name infoteka.pw;
...
это добавляю в nginx.conf
а это в конфиг сайта location ~ [^/]\.php(/|$) { сюда } fastcgi_cache WORDPRESS;
и в итоге то пустая страница, то проблема с админ баром. проблема в кеше.
как исправить?