Skip to content

NGINX Configuration

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

NGINX Configuration

A few things to take care of when configurating NGINX as a reverse proxy.

  1. Configure port forwarding
  2. Extend the file upload limit (default NGINX limit seems to be 1MB)

Port Forwarding Configuration

Example site configuration:

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

    location / {
        proxy_pass http://127.0.0.1:9000;
        proxy_redirect     off;

        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }

}

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.