Last active
December 27, 2015 09:49
-
-
Save aaronpk/7307172 to your computer and use it in GitHub Desktop.
Example nginx config for etherpad-lite to allow friendly URLs for pads.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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