Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Last active March 9, 2018 00:59
Show Gist options
  • Save thosakwe/9d7e68450ae03420386b0db4c6c22fc1 to your computer and use it in GitHub Desktop.
Save thosakwe/9d7e68450ae03420386b0db4c6c22fc1 to your computer and use it in GitHub Desktop.
Basic Angel Deployment (Ubuntu 16.04 + nginx + systemd)
server {
listen 80 default_server;
root /home/web/foo/web; # Set to your static files directory
location / {
try_files $uri @proxy; # Try to serve static files; fallback to proxied Angel server
}
location @proxy {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1; # Important, do not omit
}
}
[Unit]
Description=Angel server
[Service]
Environment=ANGEL_ENV=production
User=web # Name of unprivileged `web` user
WorkingDirectory=/home/web/foo # Path to Angel project
ExecStart=/usr/lib/dart/bin/dart bin/prod.dart
Restart=always # Restart process on crash
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment