Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save matthewcosgrove/d92e088ed3608cefe4509816f51663c7 to your computer and use it in GitHub Desktop.

Select an option

Save matthewcosgrove/d92e088ed3608cefe4509816f51663c7 to your computer and use it in GitHub Desktop.
# 'EOF' vs EOF with escaping --> https://stackoverflow.com/a/25903579/752167 and https://unix.stackexchange.com/a/405254/308152
cat <<EOF >/etc/nginx/conf.d/subsonic-proxy.conf
server {
listen 80;
server_name $SUBSONIC_SERVER_DOMAIN;
location / {
proxy_pass http://127.0.0.1:4040;
proxy_set_header Host \$http_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
}
}
EOF
cat <<EOF >/etc/systemd/system/dropbox-keep-alive.service
[Unit]
Description=Dropbox Keep Alive Service
After=network.target
[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox.py start'
ExecStop=/bin/sh -c '/usr/local/bin/dropbox.py stop'
PIDFile=${UBUNTU_USER_HOME_DIR}/.dropbox/dropbox.pid
User=jumpbox
Group=jumpbox
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment