# htpasswd file is relative to nginx conf
location / {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2061"></script>
# Nginx status
server {
listen 80;
server_name localhost;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2023"></script>
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
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2021"></script>
## Only allow these request methods
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2019"></script>
location = /favicon.ico {
access_log off;
return 204;
# or empty_gif;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2018"></script>
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;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2017"></script>
server {
listen 80;
listen 443 default ssl;
# other directives
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2016"></script>
location ~ /.svn/* {
deny all;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2009"></script>
# 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";
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2007"></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
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1999"></script>