cuebook/CueObserve

View on GitHub
ui/nginx-dev.conf.template

Summary

Maintainability
Test Coverage
server {
  listen 3000 default_server;
  server_name _;
  client_max_body_size 50M;
  gzip on;
  gzip_disable "msie6";

  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_min_length 256;
  gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

  proxy_set_header   Host                 $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;

  location /api {
      proxy_pass ${NGINX_API_URL}/api;
      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_connect_timeout 120;
      proxy_send_timeout 120;
      proxy_read_timeout 120;
      send_timeout 120;
  }

  location /alerts {
      auth_request /auth/auth;
      proxy_pass ${NGINX_ALERT_API_URL}/alerts;
      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_connect_timeout 120;
      proxy_send_timeout 120;
      proxy_read_timeout 120;
      send_timeout 120;
  }

  location /admin {
      proxy_pass ${NGINX_API_URL}/admin;
      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_connect_timeout 120;
      proxy_send_timeout 120;
      proxy_read_timeout 120;
      send_timeout 120;
  }

  location /static/admin/ {
      alias /home/staticfiles/admin/;
  }

  location /auth {
      proxy_pass ${NGINX_API_URL}/api;
      proxy_redirect off;
      proxy_set_header Host $host;
    }

  location / {
    proxy_pass ${NGINX_UI_URL};
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_connect_timeout 120;
    proxy_send_timeout 120;
    proxy_read_timeout 120;
    send_timeout 120;
  }

  error_page 404 /404.html;

  location = /404.html {
    root /usr/share/nginx/html;
    internal;
  }

  error_page 500 502 503 504 /50x.html;

  location = /50x.html {
    root /usr/share/nginx/html;
  }
}