Skip to content

Instantly share code, notes, and snippets.

@geraldyeo
Created October 25, 2017 03:14
Show Gist options
  • Save geraldyeo/544154d7be7569bd54517f26b9868329 to your computer and use it in GitHub Desktop.
Save geraldyeo/544154d7be7569bd54517f26b9868329 to your computer and use it in GitHub Desktop.
NGINX feature deployment
# default branch to serve
set $branch "master";
# Serve features on *.app.dev subdomain
if ($host ~* ^([^.]+)\.app\.dev\.company\.com$) {
set $branch $1;
}
# All branches are hosted from a subdirectory
root /var/www/branches/$branch;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment