Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. root@chs-bctest01-v / # cat /etc/nginx/nginx.conf
  2. user www-data;
  3. worker_processes 8;
  4. worker_rlimit_nofile 1024;
  5. pid /var/run/nginx.pid;
  6. error_log /var/log/nginx/error.log;
  7. events {
  8. worker_connections 1024;
  9. }
  10.  
  11. http {
  12. include /etc/nginx/mime.types;
  13. default_type application/octet-stream;
  14. access_log /var/log/nginx/access.log;
  15. sendfile on;
  16. server_tokens Off;
  17. types_hash_max_size 1024;
  18. types_hash_bucket_size 512;
  19. server_names_hash_bucket_size 64;
  20. server_names_hash_max_size 512;
  21.  
  22. keepalive_timeout 65;
  23. tcp_nodelay on;
  24.  
  25. gzip on;
  26. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  27. gzip_types text/plain
  28. text/css
  29. application/x-javascript
  30. text/xml
  31. application/xml
  32. application/xml+rss
  33. application/javascript
  34. text/x-js
  35. text/javascript;
  36. gzip_vary on;
  37. gzip_comp_level 6;
  38.  
  39. # client_body_temp_path /var/nginx/client_body_temp;
  40. client_body_temp_path /tmp/cache/imgcache/client_body_temp;
  41. client_max_body_size 10m;
  42. client_body_buffer_size 128k;
  43. proxy_redirect off;
  44. # proxy_temp_path /var/nginx/proxy_temp;
  45. proxy_temp_path /tmp/cache/imgcache/proxy_temp;
  46. proxy_connect_timeout 90;
  47. proxy_send_timeout 90;
  48. proxy_read_timeout 90;
  49. proxy_buffers 32 4k;
  50. proxy_buffer_size 8k;
  51. proxy_set_header Host $host;
  52. proxy_set_header X-Real-IP $remote_addr;
  53. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  54. proxy_headers_hash_bucket_size 64;
  55. proxy_cache_path /tmp/cache/imgcache levels=1:2 keys_zone=imgcache:100m max_size=1G inactive=600m;
  56. include /etc/nginx/conf.d/*.conf;
  57. include /etc/nginx/sites-enabled/*;
  58. }
  59.  
  60. root@chs-bctest01-v / # cat /etc/nginx/sites-enabled/default.conf
  61. server {
  62. listen *:80;
  63. server_name default;
  64. index index.html index.htm index.php;
  65. access_log /var/log/nginx/default.access.log combined;
  66. error_log /var/log/nginx/default.error.log;
  67.  
  68. location ~* \.(swf|jpg|jpeg|gif|png|ico|css|pdf|bmp|js)$ {
  69. proxy_pass http://loadbalance;
  70. proxy_read_timeout 90;
  71. proxy_connect_timeout 90;
  72. proxy_redirect off;
  73.  
  74. proxy_set_header Host $host;
  75. proxy_set_header X-Real-IP $remote_addr;
  76. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  77.  
  78. proxy_cache imgcache;
  79. proxy_cache_valid 200 301 302 60m;
  80. add_header Cache-Control "public";
  81. add_header Pragma public;
  82. }
  83.  
  84. location ~* \.(swf|jpg|jpeg|gif|png|ico|css|pdf|bmp|js)$ {
  85. expires 120m;
  86. add_header Pragma public;
  87. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  88. }
  89.  
  90. # Don't cache these pages.
  91. location ~* ^/(wp-admin|wp-login.php) {
  92. proxy_pass http://loadbalance;
  93. }
  94.  
  95. location / {
  96. proxy_pass http://loadbalance;
  97. proxy_read_timeout 90;
  98. proxy_connect_timeout 90;
  99. proxy_redirect off;
  100. }
  101.  
  102. location /nginx_status {
  103. allow 127.0.0.1;
  104. stub_status on;
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement