nginx_tomcat.conf 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. user www www;
  2. worker_processes auto;
  3. error_log /data/wwwlogs/error_nginx.log crit;
  4. pid /var/run/nginx.pid;
  5. worker_rlimit_nofile 51200;
  6. events {
  7. use epoll;
  8. worker_connections 51200;
  9. multi_accept on;
  10. }
  11. http {
  12. include mime.types;
  13. default_type application/octet-stream;
  14. server_names_hash_bucket_size 128;
  15. client_header_buffer_size 32k;
  16. large_client_header_buffers 4 32k;
  17. client_max_body_size 1024m;
  18. sendfile on;
  19. tcp_nopush on;
  20. keepalive_timeout 120;
  21. server_tokens off;
  22. tcp_nodelay on;
  23. fastcgi_connect_timeout 300;
  24. fastcgi_send_timeout 300;
  25. fastcgi_read_timeout 300;
  26. fastcgi_buffer_size 64k;
  27. fastcgi_buffers 4 64k;
  28. fastcgi_busy_buffers_size 128k;
  29. fastcgi_temp_file_write_size 128k;
  30. #Gzip Compression
  31. gzip on;
  32. gzip_buffers 16 8k;
  33. gzip_comp_level 6;
  34. gzip_http_version 1.1;
  35. gzip_min_length 256;
  36. gzip_proxied any;
  37. gzip_vary on;
  38. gzip_types
  39. text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
  40. text/javascript application/javascript application/x-javascript
  41. text/x-json application/json application/x-web-app-manifest+json
  42. text/css text/plain text/x-component
  43. font/opentype application/x-font-ttf application/vnd.ms-fontobject
  44. image/x-icon;
  45. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  46. #If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.
  47. open_file_cache max=1000 inactive=20s;
  48. open_file_cache_valid 30s;
  49. open_file_cache_min_uses 2;
  50. open_file_cache_errors on;
  51. ######################## default ############################
  52. server {
  53. listen 80;
  54. server_name _;
  55. access_log /data/wwwlogs/access_nginx.log combined;
  56. root /data/wwwroot/default;
  57. index index.html index.htm index.jsp;
  58. location /nginx_status {
  59. stub_status on;
  60. access_log off;
  61. allow 127.0.0.1;
  62. deny all;
  63. }
  64. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
  65. expires 30d;
  66. access_log off;
  67. }
  68. location ~ .*\.(js|css)?$ {
  69. expires 7d;
  70. access_log off;
  71. }
  72. location ~ {
  73. proxy_pass http://127.0.0.1:8080;
  74. include proxy.conf;
  75. }
  76. }
  77. ########################## vhost #############################
  78. include vhost/*.conf;
  79. }