Skip to content

Instantly share code, notes, and snippets.

@amiller
Created April 14, 2012 05:54
Show Gist options
  • Save amiller/2382328 to your computer and use it in GitHub Desktop.
Save amiller/2382328 to your computer and use it in GitHub Desktop.
log_format privacy_preserving
'$time_local '
'$status $bytes_sent '
'"$request_method [...]"';
server {
server_name tahoe_readonly.asus.ln.soc1024.com;
listen 9567;
access_log /var/log/nginx/tahoe_readonly.asus.ln.soc1024.com_access.log privacy_preserving;
error_log /var/log/nginx/tahoe_readonly.asus.ln.soc1024.com_error.log;
rewrite ^ https://tahoe_readonly.asus.ln.soc1024.com/ redirect;
}
server {
server_name tahoe_readonly.asus.ln.soc1024.com;
listen 443;
ssl on;
ssl_certificate /etc/ssl/private/tahoe_readonly.asus.ln.soc1024.com.cer;
ssl_certificate_key /etc/ssl/private/tahoe_readonly.asus.ln.soc1024.com.key;
access_log /var/log/nginx/tahoe_readonly.asus.ln.soc1024.com_access.log privacy_preserving;
error_log /var/log/nginx/tahoe_readonly.asus.ln.soc1024.com_error.log;
location = / {
# Redirect / to the site's front page capability (as long as the method is HEAD or GET):
limit_except HEAD GET { deny all; }
rewrite ^ /uri/URI:DIR2-RO:owbwpxci7wtajdsqefrhoukfjy:c4fukxni44zn6wj74ibobce4nbxsuba26kfjoomh7zc6bir62vga redirect;
}
location ^~ /tahoe_css
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /webform_css
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /uri/
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /cap/
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /file/
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /named/
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location ^~ /static/
{
limit_except HEAD GET { deny all; }
proxy_pass http://127.0.0.1:3456 ;
}
location /
{
# Deny all other locations:
return 403;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment