Skip to content

Instantly share code, notes, and snippets.

@sadikay
Last active November 30, 2017 15:33
Show Gist options
  • Save sadikay/ee8e76e880149c132c172a0bb176ee6a to your computer and use it in GitHub Desktop.
Save sadikay/ee8e76e880149c132c172a0bb176ee6a to your computer and use it in GitHub Desktop.
Multi branch deploy nginx side
server {
listen 80;
server_name ~^(?<branch_name>.+)\.(?<branch_prefix>.+)\.(?<app_name>.+)\.staging\.exampledomain\.com$;
root /home/apps/$app_name/$branch_prefix/$branch_name/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_pass http://unix:/home/ubuntu/apps/$app_name/$branch_prefix/$branch_name/shared/tmp/sockets/puma.sock;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment