Category: snippets

Ignore domain in nginx

I was having some trouble with duplicate content from my blog being replicated on

I added this little bit to my Pelican buildout fork and now requests to domain are denied by nginx!

http {
    server {
        listen <%= ENV["PORT"] %> default;
        rewrite ^ $scheme://$request_uri? permanent;

    server {
        listen <%= ENV["PORT"] %>;


The first server block catches all and denies them, the second only accepts requests from where we want! Yay!

— 23 April 2014
…discuss this