We have a problem with loading a pdf file which is about 300KB size on our web page. The pdf is being served by nginx. Whenever I load the file, it shows an error saying Failed to open pdf document
, but the size of the crashed file is only 32KB. I have double checked about size on the both ends.
After I checked clicked_site(client_max_body_size)
,I had added the following configuration to nginx.conf:
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 200M;
client_body_buffer_size 50M;
client_header_buffer_size 300K;
large_client_header_buffers 2 1k;
proxy_buffer_size 40k;
proxy_buffers 4 32k;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
........
........
}
sites-enabled/default:
server {
server_name www.domain.com;
#root html;
location /static/admin/ {
alias /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/;
}
location / {
# host and port to fastcgi server
fastcgi_pass 127.0.0.1:8090;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
location /site_media/ {
alias /intcen_media/;
#root /flat;
autoindex on;
}
}
In site-media I have the files directory contains pdf and swf files.
Does anyone see an error in my configuration that would cause this problem?