Skip to content

Instantly share code, notes, and snippets.

@robinwl
Last active August 29, 2015 14:20
Show Gist options
  • Save robinwl/6e0eba6e4bc8dbf04c4c to your computer and use it in GitHub Desktop.
Save robinwl/6e0eba6e4bc8dbf04c4c to your computer and use it in GitHub Desktop.
linux-dash nginx
server {
listen 80 default_server;
root /var/www/html/;
index index.html index.htm;
server_name _;
location / {
try_files $uri $uri/ =404;
}
##
# http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
##
location /nginx_status {
auth_basic off;
allow 127.0.0.1;
deny all;
stub_status on;
access_log off;
}
##
# https://github.com/afaqurk/linux-dash
##
location /dash {
root /var/www/linuxdash;
index index.html;
}
##
# Pass linux-dash dynamic content to nodejs
##
location /dash/server {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/passwd/linux-dash;
rewrite /dash/(.*)$ /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:81;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment