I'm experiencing strange behaviour with Nginx. In my case Nginx acts as proxy to Jetty. Config below:
server {
listen 80;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_max_body_size 5M;
server_name test.com www.test.com
location / {
auth_basic "Restricted area";
auth_basic_user_file /etc/nginx/htpasswd;
proxy_pass http://localhost:8080;
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 http;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
gzip on;
}
}
When uploading a file with size greater than 5M I'm getting a'Gateway timeout'. CPU usage is 0%. I've no idea what's wrong. It's not related to a network speed because I'm testing this locally.
If I skip a proxy and try to upload file to app server directly (i mean: on port 8080), everything works like a charm.
Any idea ?? Regards!