-
Notifications
You must be signed in to change notification settings - Fork 30
NGINX Configuration
Rainer Simon edited this page Apr 23, 2018
·
13 revisions
When using NGINX as a reverse proxy, there are a few extra things to take care of:
- Extend the file upload limit, as the default seems to be 1MB (!)
- Enable HTTP 1.1, as this is needed for data streaming
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.
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.
server {
listen 80;
server_name recogito.pelagios.org;
client_max_body_size 200m;
error_page 502 503 504 = @maintenance;
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:9003;
}
location @maintenance {
expires 0;
add_header Pragma "no-cache";
add_header Cache-Control "no-cache, no-store, must-revalidate";
root /var/www/html;
try_files $uri /50x.html =502;
}
}
server {
listen 80;
server_name pelagios.org;
client_max_body_size 500m;
root /var/www/html;
location /recogito {
proxy_pass http://127.0.0.1:9001;
}
location /peripleo {
proxy_pass http://127.0.0.1:9002;
}
}