olmesm / surge-clone

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Surge Clone

Replicating the features of https://surge.sh with Nginx and Caddy server

Note: This was done late with 🍺; config may be a mix between localhost and lvh.me.


Run with sh run-nginx.sh or sh run-caddy.sh

curl --location --request GET http://lvh.me # => sites/index.html
curl --location --request GET http://site-1.lvh.me # => sites/site-1/index.html
curl --location --request GET http://site-1.lvh.me/x # => sites/site-1/200.html
curl --location --request GET http://site-1.lvh.me/404 # => sites/site-1/404.html
curl --location --request GET 'http://lvh.me' \
--header 'Host: site-1.local' # => sites/site-1.local/index.html
curl --location --request GET 'http://lvh.me/x' \
--header 'Host: site-1.local' # => sites/50x.html


  • subdomain handling
  • cname (host header) handling
  • error page
  • root page
  • 200.(html|json)
  • content type headers
  • auth (oauth2-proxy)
  • ROUTES - custom re-writes
  • CORS



Language:Shell 63.6%Language:HTML 36.4%