-
-
# htpasswd file is relative to nginx conf
-
location / {
-
auth_basic “Restricted”;
-
auth_basic_user_file conf/htpasswd;
-
}
-
-
-
# Nginx status
-
server {
-
listen 80;
-
server_name localhost;
-
location /nginx_status {
-
stub_status on;
-
access_log off;
-
allow 127.0.0.1;
-
deny all;
-
}
-
}
-
-
if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]+$") { access_log off; expires 31d; break; } # Matching URLs http://domain.com/stylesheets/blog.css?1221178271 if ($request_uri ~* "\.(ico|gif|png|jpe?g|css|js|swf)(\?v\d\d?)?$") { access_log off; expires 31d; break; } # Matching URLs http://domain.com/stylesheets/blog.css http://domain.com/stylesheets/blog.css?v1 http://domain.com/stylesheets/blog.css?v12
-
-
-
## Only allow these request methods
-
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
-
return 444;
-
}
-
-
-
location = /favicon.ico {
-
access_log off;
-
return 204;
-
# or empty_gif;
-
}
-
-
server { server_name mysite.tld ~^.+.mysite.tld$; map $host $files { default common; mysite.tld common; www.mysite.tld common; admin.mysite.tld admin; system.mysite.tld system; *.mysite.tld users; } root /var/www/mysite/$files; }
-
-
server {
-
listen 80;
-
listen 443 default ssl;
-
# other directives
-
}
-
-
location ~ /.svn/* { deny all; }
-
-
# Add this line to your “vhost”
-
fastcgi_param DEBUG “uri=$uri request_uri=$request_uri
-
request_filename=$request_filename query_string=$query_string is_args=
-
$is_args document_uri=$document_uri document_root=$document_root args=
-
$args fastcgi_script_name=$fastcgi_script_name path_info=$path_info script=$script”;
-
-
-
# Add the file /etc/logrotate.d/nginx with the following content:
-
/path/to/log/nginx_* {
-
missingok
-
notifempty
-
compress
-
sharedscripts
-
postrotate
-
test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid`
-
endscript
-
}
“nginx” related tags
spirit’s tags
access apache apache2 apt arguments auditd auth awk backup backups bandwidth bash bridge cache cd charset cisco commands conversion cron css date debian debug default diff directories directory distance dns dom du eth ethernet excel exclude files find firefox flash forms function hacks headers history hosts htaccess html http https ie ifconfig images input ip javascript jobs kill latitude linux log logging longitude mac mail maps merge monitoring mysql network nginx openssl packages performance performances perl php red hat regex restore root route rpm script security server shell ssh ssl svn switch syslog tail trunk unix virtualhost vlan vmware windows yum
-