Ethernotes.

I recently set up Etherpad for use on my domain. This blog post will essentially be a repository for information about deployment and optimizations I do to make it more performant.

Setup

  • Deploy in Docker:
docker run -it -d -e MYSQL_ROOT_PASSWORD=somethingsecure -d --name etherdb mariadb  
docker run -it -d --link etherdb:mysql -p 10.100.0.6:9001:9001 --name etherpad -e ETHERPAD_ADMIN_PASSWORD="somethingsecure" tvelocity/etherpad-lite  
  • Proxy through Nginx:
    # This initial socket.io location is to ensure that all new socket.io connections
    # get forwarded to the correct place -- fixes problems with /admin/plugins
    location /socket.io {
        if ($http_referer ~* /etherpad/(.*)) {
            rewrite /socket.io/(.*) /etherpad/socket.io/$1 last;
        }
    }

    location /etherpad {
        rewrite /etherpad/(.*) /$1 break;
        rewrite ^/etherpad$ /etherpad/ permanent;

        add_header Cache-Control "no-store";

        proxy_pass http://10.100.0.6:9001/;
        proxy_pass_header Server;
        proxy_redirect / /etherpad/;
        proxy_set_header Host $host;
        proxy_buffering off;
    }

    location ~* ^/etherpad/(static|javascripts) {
        rewrite /etherpad/(static|javascripts)/(.*) /$1/$2 break;

        proxy_cache static;
        proxy_cache_bypass $http_cache_control;
        add_header X-Proxy-Cache $upstream_cache_status;

        proxy_pass http://10.100.0.6:9001;
        proxy_pass_header Server;
        proxy_redirect / /etherpad/;
        proxy_set_header Host $host;
        proxy_buffering off;
    }


    location /etherpad/socket.io {
        rewrite /etherpad/socket.io/(.*) /socket.io/$1 break;
        proxy_pass http://10.100.0.6:9001/;
        proxy_set_header Host $host;
        proxy_buffering off;
    }

Sean Johnson

Software developer, music enthusiast, college student, and cat lover. Currently enthralled by the world of networking, security, and cloud technology.

San Antonio, TX https://blog.maio.me

Subscribe to Land of Weird Things

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!