# 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; } # EasyEngine Shared Settings location /ee/ { autoindex on; alias /var/www/shared/; satisfy any; auth_basic "Restricted Area"; auth_basic_user_file htpasswd-ee; include common/allowed_ip.conf; index index.php index.html index.htm; location ~ ^/ee(.+\.php)$ { alias /var/www/shared$1; fastcgi_pass php; include /etc/nginx/fastcgi_params; } location ~* ^/ee(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { alias /var/www/shared$1; } } # PMA Settings location /pma { rewrite ^/* /ee/pma last; } location /phpMyAdmin { rewrite ^/* /ee/pma last; } location /phpmyadmin { rewrite ^/* /ee/pma last; } # Status Pages location /nginx_status { stub_status on; access_log off; satisfy any; auth_basic "Restricted Area"; auth_basic_user_file htpasswd-ee; include common/allowed_ip.conf; } location ~ ^/(status|ping) { include fastcgi_params; fastcgi_pass php; satisfy any; auth_basic "Restricted Area"; auth_basic_user_file htpasswd-ee; include common/allowed_ip.conf; } # Security Settings For Better Privacy # Deny Hidden Files location ~ /\. { deny all; access_log off; log_not_found off; } # Deny Backup Extensions & Log Files location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp)$ { deny all; access_log off; log_not_found off; } # Return 403 Forbidden For readme.(txt|html) or license.(txt|html) if ($request_uri ~* "^.+(readme|license)\.(txt|html)$") { return 403; }