Skip to content

Instantly share code, notes, and snippets.

@micahhausler
Last active January 2, 2016 08:09
Show Gist options
  • Save micahhausler/8275006 to your computer and use it in GitHub Desktop.
Save micahhausler/8275006 to your computer and use it in GitHub Desktop.
NGINX configuration for a Django heartbeat.
server {
listen 10.10.10.10:80;
server_name demo.ambition.io;
location /heartbeat {
set $my_host $host;
if ($host ~ "\d+\.\d+\.\d+\.[\d\:]+") {
set $my_host "demo.ambition.io";
}
uwsgi_param HTTP_HOST $my_host;
include uwsgi_params;
uwsgi_pass 127.0.0.1:1111;
access_log /var/log/nginx/demo.ambition.io.heartbeat.log buffer=128k;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:1111;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment