NGNIX configuration and W3 total cache 404 error
-
Hi,
I included the ngnix.con file in my NGNIX configuration, but when I enable the PAGE CACHE on the plugin I display the home page of my website only.
When I go on other website pages I display “404 error not found”
Following the setting of my ngnix.conf file
Can I solve the problem?
_________________# BEGIN W3TC Page Cache cache
location ~ /wp-content/cache/page_enhanced.*html$ {
expires modified 3600s;
add_header X-Powered-By “W3 Total Cache/0.9.7.4”;
add_header Vary “Accept-Encoding, Cookie”;
add_header Pragma “public”;
add_header Cache-Control “public”;
}
location ~ /wp-content/cache/page_enhanced.*gzip$ {
gzip off;
types {}
default_type text/html;
expires modified 3600s;
add_header X-Powered-By “W3 Total Cache/0.9.7.4”;
add_header Vary “Accept-Encoding, Cookie”;
add_header Pragma “public”;
add_header Cache-Control “public”;
add_header Content-Encoding gzip;
}
# END W3TC Page Cache cache
# BEGIN W3TC Browser Cache
gzip on;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd
.ms-fontobject application/x-msdownload image/x-icon image/webp application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.databas
e application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application
/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel;
location ~ \.(css|htc|less|js|js2|js3|js4)$ {
expires 31536000s;
etag on;
if_modified_since exact;
add_header Pragma “public”;
add_header Cache-Control “public”;
add_header X-Powered-By “W3 Total Cache/0.9.7.4”;
try_files $uri $uri/ $uri.html /index.php?$args;
}
location ~ \.(html|htm|rtf|rtx|svg|txt|xsd|xsl|xml)$ {
expires 3600s;
etag on;
if_modified_since exact;
add_header Pragma “public”;
add_header Cache-Control “public”;
add_header X-Powered-By “W3 Total Cache/0.9.7.4”;
try_files $uri $uri/ $uri.html /index.php?$args;
}
location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ra
m|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip)$ {
expires 31536000s;
etag on;
if_modified_since exact;
add_header Pragma “public”;
add_header Cache-Control “public”;
add_header X-Powered-By “W3 Total Cache/0.9.7.4”;
try_files $uri $uri/ $uri.html /index.php?$args;
}
add_header Referrer-Policy “no-referrer-when-downgrade”;
# END W3TC Browser Cache
# BEGIN W3TC Page Cache core
set $w3tc_rewrite 1;
if ($request_method = POST) {
set $w3tc_rewrite 0;
}
if ($query_string != “”) {
set $w3tc_rewrite 0;
}
if ($request_uri !~ \/$) {
set $w3tc_rewrite 0;
}
if ($http_cookie ~* “(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)”) {
set $w3tc_rewrite 0;
}
set $w3tc_ua “”;
if ($http_user_agent ~* “((android|bb\d+|meego).+mobile|2.0\ mmp|240×320|\bppc\b|acer\ s100|alcatel|amoi|archos5|asus|au-mic|audiovox|avantgo|bada|benq|bird|blackberry|blazer|cdm|cellphone|cupcake|danger|ddipocket|docomo|docomo\ ht-03a|do
pod|dream|elaine/3.0|ericsson|eudoraweb|fly|froyo|googlebot-mobile|haier|hiptop|hp.ipaq|htc|htc\ hero|htc\ magic|htc_dream|htc_magic|huawei|i-mobile|iemobile|iemobile/7|iemobile/7.0|iemobile/9|incognito|iphone|ipod|j-phone|kddi|konka|kwc|
kyocera/wx310k|lenovo|lg|lg-gw620|lg/u990|lge\ vx|liquid\ build|maemo|midp|midp-2.0|mmef20|mmp|mobilephone|mot-mb200|mot-mb300|mot-v|motorola|msie\ 10.0|netfront|newgen|newt|nexus\ 7|nexus\ one|nintendo\ ds|nintendo\ wii|nitro|nokia|novar
ra|openweb|opera.mobi|opera\ mini|opera\ mobi|p160u|palm|panasonic|pantech|pdxgw|pg|philips|phone|playbook|playstation\ portable|portalmmm|proxinet|psp|qtek|s8000|sagem|samsung|samsung-s8000|sanyo|sch|sch-i800|sec|sendo|series60.*webkit|s
eries60/5.0|sgh|sharp|sharp-tq-gx10|small|smartphone|softbank|sonyericsson|sonyericssone10|sonyericssonu20|sonyericssonx10|sph|symbian|symbian\ os|symbianos|t-mobile\ mytouch\ 3g|t-mobile\ opal|tattoo|toshiba|touch|treo|ts21i-10|up.browse
r|up.link|uts|vertu|vodafone|wap|webmate|webos|willcome|windows.ce|windows\ ce|winwap|xda|xoom|zte)”) {
set $w3tc_ua _phones;
}
if ($http_user_agent ~* “(a1-32ab0|a210|a211|b6000-h|b8000-h|bnrv200|bntv400|darwin|gt-n8005|gt-p3105|gt-p6810|gt-p7510|hmj37|hp-tablet|hp\sslate|hp\sslatebook|ht7s3|ideatab_a1107|ideataba2109a|ideos\ss7|imm76d|ipad|k00f|kfjwi|kfot|kftt|k
indle|l-06c|lg-f200k|lg-f200l|lg-f200s|m470bsa|m470bse|maxwell|me173x|mediapad|midc497|msi\senjoy\s10\splus|mz601|mz616|nexus|nookcolor|pg09410|pg41200|pmp5570c|pmp5588c|pocketbook|qmv7a|sgp311|sgpt12|shv-e230k|shw-m305w|shw-m380w|sm-p605
|smarttab|sonysgp321|sph-p500|surfpad|tab07-200|tab10-201|tab465euk|tab474|tablet|tegranote|tf700t|thinkpad|viewpad|voltaire)”) {
set $w3tc_ua _tablets;
}
set $w3tc_preview “”;
if ($http_cookie ~* “(w3tc_preview)”) {
set $w3tc_preview _preview;
}
set $w3tc_ssl “”;
if ($scheme = https) {
set $w3tc_ssl _ssl;
}
if ($http_x_forwarded_proto = ‘https’) {
set $w3tc_ssl _ssl;
}
set $w3tc_enc “”;
if ($http_accept_encoding ~ gzip) {
set $w3tc_enc _gzip;
}
if (!-f “$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ua$w3tc_ssl$w3tc_preview.html$w3tc_enc”) {
set $w3tc_rewrite 0;
}
if ($w3tc_rewrite = 1) {
rewrite .* “/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ua$w3tc_ssl$w3tc_preview.html$w3tc_enc” last;
}
# END W3TC Page Cache core
- The topic ‘NGNIX configuration and W3 total cache 404 error’ is closed to new replies.