You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.4 KiB
78 lines
1.4 KiB
# Common Locations
|
|
|
|
|
|
# Basic Locations Files
|
|
location = /favicon.ico {
|
|
access_log off;
|
|
log_not_found off;
|
|
expires max;
|
|
}
|
|
|
|
location = /robots.txt {
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Cache Static Files For As Long As Possible
|
|
location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
|
|
access_log off;
|
|
log_not_found off;
|
|
expires max;
|
|
}
|
|
|
|
# PMA Settings
|
|
location /phpmyadmin {
|
|
root /usr/share/;
|
|
index index.php index.html index.htm;
|
|
|
|
location ~ ^/phpmyadmin/(.+\.php)$ {
|
|
try_files $uri =404;
|
|
root /usr/share/;
|
|
fastcgi_pass php;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
include /etc/nginx/fastcgi_params;
|
|
}
|
|
|
|
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
|
|
root /usr/share/;
|
|
}
|
|
}
|
|
|
|
location /phpMyAdmin {
|
|
rewrite ^/* /phpmyadmin last;
|
|
}
|
|
|
|
location /pma {
|
|
rewrite ^/* /phpmyadmin last;
|
|
}
|
|
|
|
|
|
# Security Settings For Better Privacy
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
location ~* ^.+.log$ {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
location ~ /readme\.(txt|html)$ {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Disallow PHP In Upload Folder
|
|
location /wp-content/uploads/ {
|
|
|
|
location ~ \.php$ {
|
|
#Prevent Direct Access Of PHP Files From Web Browsers
|
|
deny all;
|
|
}
|
|
}
|
|
|