nginx_tomcat.conf 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. client_body_buffer_size 10m;
  19. sendfile on;
  20. tcp_nopush on;
  21. keepalive_timeout 120;
  22. server_tokens off;
  23. tcp_nodelay on;
  24. fastcgi_connect_timeout 300;
  25. fastcgi_send_timeout 300;
  26. fastcgi_read_timeout 300;
  27. fastcgi_buffer_size 64k;
  28. fastcgi_buffers 4 64k;
  29. fastcgi_busy_buffers_size 128k;
  30. fastcgi_temp_file_write_size 128k;
  31. #Gzip Compression
  32. gzip on;
  33. gzip_buffers 16 8k;
  34. gzip_comp_level 6;
  35. gzip_http_version 1.1;
  36. gzip_min_length 256;
  37. gzip_proxied any;
  38. gzip_vary on;
  39. gzip_types
  40. text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
  41. text/javascript application/javascript application/x-javascript
  42. text/x-json application/json application/x-web-app-manifest+json
  43. text/css text/plain text/x-component
  44. font/opentype application/x-font-ttf application/vnd.ms-fontobject
  45. image/x-icon;
  46. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  47. #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.
  48. open_file_cache max=1000 inactive=20s;
  49. open_file_cache_valid 30s;
  50. open_file_cache_min_uses 2;
  51. open_file_cache_errors on;
  52. ######################## default ############################
  53. server {
  54. listen 80;
  55. server_name _;
  56. access_log /data/wwwlogs/access_nginx.log combined;
  57. root /data/wwwroot/default;
  58. index index.html index.htm index.jsp;
  59. location /nginx_status {
  60. stub_status on;
  61. access_log off;
  62. allow 127.0.0.1;
  63. deny all;
  64. }
  65. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
  66. expires 30d;
  67. access_log off;
  68. }
  69. location ~ .*\.(js|css)?$ {
  70. expires 7d;
  71. access_log off;
  72. }
  73. location ~ {
  74. proxy_pass http://127.0.0.1:8080;
  75. include proxy.conf;
  76. }
  77. }
  78. ########################## vhost #############################
  79. include vhost/*.conf;
  80. }