server { listen 80; server_name clansphere; root html; location / { autoindex off; charset utf-8; index index.html index.htm index.php; ## The following lines are required to use the "Pretty URLs" feature set $exists ""; if (!-d $request_filename){ set $exists D; } if (!-f $request_filename){ set $exists F$exists; } if ($exists = "FD"){ rewrite ^/([^/]+)(.*)$ /$1.php?params=$2; } } ## Warning: Be sure to set PHP option "cgi.fix_pathinfo" to 0 location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9123; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ## Do not allow Apache config files to be displayed location ~ /\.ht { deny all; } ## Do not log favicon not found errors location ~ /\favicon.ico { log_not_found off; } }