Skip to content

Instantly share code, notes, and snippets.

@aaronpk
Last active December 27, 2015 09:49
Show Gist options
  • Save aaronpk/7307172 to your computer and use it in GitHub Desktop.
Save aaronpk/7307172 to your computer and use it in GitHub Desktop.
Example nginx config for etherpad-lite to allow friendly URLs for pads.
upstream etherpad-lite {
server 127.0.0.1:8080;
}
server {
listen 80;
# Allow normal files to pass through
location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) {
proxy_buffering off;
proxy_pass http://etherpad-lite;
}
# Redirect to force /p/* URLs to the friendly version
location /p/ {
rewrite ^/p/(.*) /$1 redirect;
}
# Match the home page
location ~ ^/$ {
proxy_buffering off;
proxy_pass http://etherpad-lite;
}
# Handle pad URLs here
location / {
proxy_buffering off;
proxy_pass http://etherpad-lite/p/;
proxy_redirect / /p/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment