Skip to content

NGINX Configuration

Rainer Simon edited this page Dec 6, 2016 · 13 revisions

NGINX Configuration

When using NGINX as a reverse proxy, there are a few extra things to take care of

  1. Extend the file upload limit (default NGINX limit seems to be 1MB)
  2. Enable HTTP 1.1

Enabling HTTP 1.1

NGINX will use HTTP 1.0 by default. However, Recogito needs support for chunked responses which is only supported in HTTP 1.1. (This is used specifically for fetching CSV data in the table view.) Add proxy_http_version 1.1; to the site configuration.

Extending the file upload limit

To set the limit globally, add the line client_max_body_size 200M; to the http section of the nginx.conf file.

To set it for Recogito specifically (recommended), add client_max_body_size 200M; to the server or location part of the site configuration.

Full Site Config Example

server {
    listen 80;
    client_max_body_size       500m;
    
    location /recogito {
        proxy_pass http://127.0.0.1:9001;
    }

    location / {
        proxy_http_version 1.1;
        
        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;

        proxy_pass http://127.0.0.1:9000;
    }

}

Clone this wiki locally