Hi. How can we help?

Nginx Configuration

14 Mar 2018 in: Tips and Tricks

Default ngnix config file

# nginx configuration 
autoindex off; 

location / { 
if ($request_uri ~ "^(.*)/{2,}(.*)$"){ 
  rewrite ^/(.*)$ /%1/%2 redirect; 
  } 
  if ($request_uri ~ "/+[^\.]+$"){ 
    rewrite ^/(.+[^/])$ /$request_uri/ redirect; 
  } 
  if (!-e $request_filename){ 
    rewrite ^/(.*)$ /index.php break; 
  } 
} 
location ~ \.(htaccess|htpasswd|ini|log|sh|inc|bak|cache|tpl)$ { 
  deny all; 
}