aix1420
Forum Replies Created
Viewing 1 replies (of 1 total)
-
I have the same problem, The parmalinks are working fine on my website, but not working on sub-directory named it demo. My nginx.conf file is as below :
Can anybody help me to resolve it# For more information on configuration, see: # * Official English Documentation: https://nginx.org/en/docs/ # * Official Russian Documentation: https://nginx.org/ru/docs/ user nginx; worker_processes 4; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; keepalive_disable msie6; #gzip on; gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 3; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; geoip_country /etc/nginx/geodata/GeoIP.dat; geoip_city /etc/nginx/geodata/GeoLiteCity.dat; # Load config files from the /etc/nginx/conf.d directory # The default server is in conf.d/default.conf include /etc/nginx/conf.d/*.conf; } # worker_processes 1; # events { # worker_connections 1024; # } http { include mime.types; default_type application/octet-stream; log_format main '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time status $status bytes $body_bytes_sent'; #Uncomment to debug rewrite rules #rewrite_log on; server { ssl_protocols TLSv1 TLSv1.1 TLSv1.2; listen 81; server_name test1.com; access_log /var/log/nginx/test1.access.log main; # access_log logs/test1.access.log main; #Uncomment to debug rewrite rules #error_log logs/rewrite.log notice; root /usr/local/test1; index index.php; # WORDFENCE FALCON ENGINE CODE #Match on gzip first because ordering matters. location ~ "/site/wp-content/wfcache/.*gzip$" { gzip off; types {} default_type text/html; add_header Vary "Accept-Encoding, Cookie"; add_header Content-Encoding gzip; } #If the previous matched, the following location won't be executed. location ~ /site/wp-content/wfcache/.* { add_header Vary "Accept-Encoding, Cookie"; } set $wordfenceCacheOn 1; #Don't cache form submissions. if ($request_method = POST) { set $wordfenceCacheOn 0; } #Allow caching of /?123=123 because this is a common DDoS to override caches. if ($query_string !~ "^(?:\d+=\d+)?$") { set $wordfenceCacheOn 0; } #Only cache URL's ending in / if ($request_uri !~ \/$) { set $wordfenceCacheOn 0; } #Don't cache any cookies with this in their names e.g. users who are logged in. if ($http_cookie ~* "(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher)") { set $wordfenceCacheOn 0; } set $wordfenceEncoding ""; #Oh, you want gzipped content? if ($http_accept_encoding ~ gzip) { set $wordfenceEncoding _gzip; } set $wordfenceHTTPS ""; if ($scheme = 'https'){ #If you want to ENABLE HTTPS caching, comment out the next line. set $wordfenceCacheOn 0; #Comment this line out to enable HTTPS caching. set $wordfenceHTTPS '_https'; #Uncomment this line to enable HTTPS caching. } #The main purpose of this line is to capture the URL components into variables. if ($request_uri !~ "^\/*(?<wfone>[^\/]*)\/*(?<wftwo>[^\/]*)\/*(?<wfthree>[^\/]*)\/*(?<wffour>[^\/]*)\/*(?<wffive>[^\/]*)(?<wfsix>.*)$"){ set $wordfenceCacheOn 0; } #If the file doesn't exist then don't serve from cache. if (!-f "$document_root/site/wp-content/wfcache/${http_host}_${wfone}/${wftwo}~${wfthree}~${wffour}~${wffive}~${wfsix}_wfcache${wordfenceHTTPS}.html${wordfenceEncoding}") { set $wordfenceCacheOn 0; } if ($wordfenceCacheOn = 1) { rewrite .* "/site/wp-content/wfcache/${http_host}_${wfone}/${wftwo}~${wfthree}~${wffour}~${wffive}~${wfsix}_wfcache${wordfenceHTTPS}.html${wordfenceEncoding}" last; } # END Wordfence Rules location / { try_files $uri $uri/ /index.php?$args ; } location /demo { try_files $uri $uri/ /demo/index.php?$args; } location ~ .php$ { try_files $uri /index.php; include fastcgi_params; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; fastcgi_pass unix:/var/run/php5-fpm.sock; } } }
Viewing 1 replies (of 1 total)