Advertisement
Guest User

Untitled

a guest
Jul 8th, 2015
40
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################
  2. ### example.ru.conf
  3. ### HTTP config
  4. ################################
  5.  
  6. upstream http_example_ru { # HTTP
  7. server 5.5.5.5:80;
  8. keepalive 50;
  9. }
  10.  
  11. upstream cache_http_example_ru{ # Cache
  12. server 10.0.2.37:6081 fail_timeout=60s;
  13. server 5.5.5.5:80 backup;
  14. keepalive 50;
  15. }
  16.  
  17. server { # HTTP
  18. listen 1.1.1.1:80;
  19. server_name .example.ru;
  20. location / {
  21. proxy_pass http://http_example_ru;
  22. proxy_bind 1.1.1.1;
  23. }
  24.  
  25. location /socket.io/ {
  26. proxy_pass http://http_example_ru;
  27. proxy_bind 1.1.1.1;
  28. proxy_read_timeout 1000s;
  29. }
  30.  
  31. location ~ \.(png|jpe?g|css|js|gif|ico|bmp|exe|woff2?|eot|zip|mp3|ogg|wav|cur)$ {
  32. proxy_pass http://cache_http_example_ru;
  33. proxy_bind 1.1.1.1;
  34. proxy_buffering off;
  35. gzip_proxied off;
  36. proxy_next_upstream error timeout;
  37. proxy_connect_timeout 20;
  38. }
  39. }
  40.  
  41. server { # Server for varhnish cache requests (loop)
  42. listen 10.0.2.3:81;
  43. server_name .example.ru;
  44. keepalive_requests 10000;
  45.  
  46. # No Logging for loopback requests
  47. access_log off;
  48.  
  49. location / {
  50. proxy_bind 1.1.1.1;
  51. proxy_pass http://http_example_ru;
  52. }
  53. }
  54.  
  55. ### end of HTTP config
  56.  
  57. ################################
  58. ### example.ru.conf
  59. ### HTTPS config
  60. ################################
  61.  
  62. upstream https_example_ru { # HTTPS
  63. server 5.5.5.5:443;
  64. keepalive 50;
  65. }
  66.  
  67. upstream cache_https_example_ru { # Cache
  68. server 10.0.2.37:6080 fail_timeout=60s;
  69. server 5.5.5.5:443 backup;
  70. keepalive 50;
  71. }
  72.  
  73. server { # HTTPS
  74. listen 1.1.1.1:443 spdy so_keepalive=on;
  75. server_name .example.ru;
  76. ssl on;
  77. ssl_certificate customer-sites/ssl-cert/example.ru.cert;
  78. ssl_certificate_key customer-sites/ssl-cert/example.ru.key;
  79.  
  80. location / {
  81. proxy_pass https://https_example_ru;
  82. proxy_bind 1.1.1.1;
  83. }
  84.  
  85. location /socket.io/ {
  86. proxy_pass https://https_example_ru;
  87. proxy_bind 1.1.1.1;
  88. proxy_read_timeout 1000s;
  89. }
  90.  
  91. location ~ \.(png|jpe?g|css|js|gif|ico|bmp|exe|woff2?|eot|zip|mp3|ogg|wav|cur)$ {
  92. proxy_pass http://cache_https_example_ru;
  93. proxy_bind 1.1.1.1;
  94. proxy_buffering off;
  95. gzip_proxied off;
  96. proxy_next_upstream error timeout;
  97. proxy_connect_timeout 20;
  98. }
  99. }
  100.  
  101. server { # Server for varhnish cache requests (loop)
  102. listen 10.0.2.3:82;
  103. server_name .example.ru;
  104. keepalive_requests 10000;
  105.  
  106. # No Logging for loopback requests
  107. access_log off;
  108.  
  109. location / {
  110. proxy_bind 1.1.1.1;
  111. proxy_pass https://https_example_ru;
  112. }
  113. }
  114.  
  115. ### end of HTTPS config
Advertisement
RAW Paste Data Copied
Advertisement