cattr-app/frontend-application

View on GitHub
cattr_server.conf

Summary

Maintainability
Test Coverage
upstream backend {
    server backend:8090;
}

server {
  listen 80 default;
  server_name _;
  root /app;
  index index.html;

  location / {
    try_files $uri $uri/ /;
  }

  error_page 500 502 503 403 @fallback;

  location @fallback {
    try_files $uri /500.html;
  }

  location /index.html {
    expires epoch;
  }

  location /api {
    try_files $uri @octane;
  }

  location @octane {
    rewrite ^/api/(.+)$ /$1 break;

    proxy_send_timeout 300;
    proxy_read_timeout 300;

    client_max_body_size 64M;

    proxy_set_header Host $http_host;
    proxy_set_header SERVER_PORT $server_port;
    proxy_set_header REMOTE_ADDR $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_pass http://backend$uri?$query_string;
  }

  location /storage {
    try_files $uri @octane;
  }

  location /vendor {
    try_files $uri @octane;
  }

  location /telescope {
    try_files $uri @octane;
  }

  location /clockwork {
    try_files $uri @octane;
  }

  location /__clockwork {
    try_files $uri @octane;
  }
}