Wednesday, August 24, 2011

Making the Web suck less

Yesterday I came across Dan Pollock’s page about hosts and I decided to try it.
First of all I was impacted by how many sites I read daily were affected. Then I was disappointed because I was noticing the lack of ads at every place I saw the “Counldn’t connect” notice. This was the exact opposite of the initial purpose.

“No Spam” by David Hegarty (flickr)
The problem is that I had my brain already trained to avoid most of the ads, but not to avoid missing web
resources. As I spend most of my computer time on Web development enabled machines, I almost always have a
webserver on. This came to my rescue in the form of a catchall location on my nginx configuration that picks
every request to localhost that is not a previously configured location, and sets a discrete and visually
avoidable 404 error page for all of them.
In case you feel tempted to follow my steps, here you have my setup:
At /opt/nginx/sites-available/spam-eater:

    server {
        listen          80 default_server;
        server_name     _;
        error_page      404 = /index.html;
        index           index.html;
        root            /path/to/no_ads;

At /path/to/no_ads:

    <!DOCTYPE html>
    <html lang="es">
    <meta charset="utf-8">
    <title>No ads</title>
    No ads today :-)


  1. Very good post!!!!!
    This is the beginning of the end for companies that, like Google, have based their entire business models on providing free content to consumers by festooning Web pages with paid advertisements...


  2. This is genuinely an awesome read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome!
    Web Development


  3. Respecting the time and exertion you put into your site and point by point data you offer!..
    Web Development

  4. Some of these people decided they better do all the work themselves, struggled terribly trying to literally learn a whole new profession.for more information about website design visit here