Hi everyone,
A kind of strange problem: Wordpress subpages works with and without trailing slash.
They should always end with a trailing slash (Wordrpess do this already, but it's possbile to enter the same page without the slash).
Here my additional nginx directives:
PHP 7.2.10 cofigured as FPM served by NGINX.
A kind of strange problem: Wordpress subpages works with and without trailing slash.
They should always end with a trailing slash (Wordrpess do this already, but it's possbile to enter the same page without the slash).
Here my additional nginx directives:
Code:
fastcgi_read_timeout 300;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
if (!-e $request_filename) { rewrite ^(.*)$ /index.php?q=$1 last; break; }
if ($request_uri !~ "^/wp-json") { rewrite ^([^.]*[^/])$ $1/ permanent; }
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# try_files in locations is required to pre-empt the above rewrite
# Security directives of iThemes Security
include "/var/www/vhosts/website.url/nginx.conf";
include "/var/www/vhosts/website.url/wp-content/uploads/wpseo-redirects/.redirects";
# Now the generic stuff which is good for all PHP sites
location = /nginx.conf { deny all; }
location ~* \.(txt)$ { charset utf-8; }
# Pics and Fonts valid 90 Days in Cache
location ~* \.(png|jpg|jpeg|gif|ico|bmp|img|ttf|otf|eot|svg|woff|webp)$ {
expires 4w;
add_header Pragma public;
add_header Cache-Control public;
try_files $uri @fallback;
}
# Zips + PDF valid 4 weeks in Cache
location ~* \.(bz2|exe|gz|pdf|rar||tgz|zip)$ {
expires 4w;
add_header Pragma public;
add_header Cache-Control public;
try_files $uri @fallback;
}
# Media files (large) valid 2 months in Cache
location ~* \.(ac3|avi|flv|iso|mp3|mp4|mpeg|mpg|ogg|qt|rm|swf|wav)$ {
expires 2m;
add_header Pragma public;
add_header Cache-Control public;
try_files $uri @fallback;
}
# Possibly modified content valid 1 week in Cache
location ~* \.(js|css|htm|html|xhtml|xml|dat|doc|docx|dts|ppt|pptx|tar|txt|xls|xlsx)$ {
expires 1w;
add_header Pragma public;
add_header Cache-Control public;
try_files $uri @fallback;
}
PHP 7.2.10 cofigured as FPM served by NGINX.