Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################
- ### example.ru.conf
- ### HTTP config
- ################################
- upstream http_example_ru { # HTTP
- server 5.5.5.5:80;
- keepalive 50;
- }
- upstream cache_http_example_ru{ # Cache
- server 10.0.2.37:6081 fail_timeout=60s;
- server 5.5.5.5:80 backup;
- keepalive 50;
- }
- server { # HTTP
- listen 1.1.1.1:80;
- server_name .example.ru;
- location / {
- proxy_pass http://http_example_ru;
- proxy_bind 1.1.1.1;
- }
- location /socket.io/ {
- proxy_pass http://http_example_ru;
- proxy_bind 1.1.1.1;
- proxy_read_timeout 1000s;
- }
- location ~ \.(png|jpe?g|css|js|gif|ico|bmp|exe|woff2?|eot|zip|mp3|ogg|wav|cur)$ {
- proxy_pass http://cache_http_example_ru;
- proxy_bind 1.1.1.1;
- proxy_buffering off;
- gzip_proxied off;
- proxy_next_upstream error timeout;
- proxy_connect_timeout 20;
- }
- }
- server { # Server for varhnish cache requests (loop)
- listen 10.0.2.3:81;
- server_name .example.ru;
- keepalive_requests 10000;
- # No Logging for loopback requests
- access_log off;
- location / {
- proxy_bind 1.1.1.1;
- proxy_pass http://http_example_ru;
- }
- }
- ### end of HTTP config
- ################################
- ### example.ru.conf
- ### HTTPS config
- ################################
- upstream https_example_ru { # HTTPS
- server 5.5.5.5:443;
- keepalive 50;
- }
- upstream cache_https_example_ru { # Cache
- server 10.0.2.37:6080 fail_timeout=60s;
- server 5.5.5.5:443 backup;
- keepalive 50;
- }
- server { # HTTPS
- listen 1.1.1.1:443 spdy so_keepalive=on;
- server_name .example.ru;
- ssl on;
- ssl_certificate customer-sites/ssl-cert/example.ru.cert;
- ssl_certificate_key customer-sites/ssl-cert/example.ru.key;
- location / {
- proxy_pass https://https_example_ru;
- proxy_bind 1.1.1.1;
- }
- location /socket.io/ {
- proxy_pass https://https_example_ru;
- proxy_bind 1.1.1.1;
- proxy_read_timeout 1000s;
- }
- location ~ \.(png|jpe?g|css|js|gif|ico|bmp|exe|woff2?|eot|zip|mp3|ogg|wav|cur)$ {
- proxy_pass http://cache_https_example_ru;
- proxy_bind 1.1.1.1;
- proxy_buffering off;
- gzip_proxied off;
- proxy_next_upstream error timeout;
- proxy_connect_timeout 20;
- }
- }
- server { # Server for varhnish cache requests (loop)
- listen 10.0.2.3:82;
- server_name .example.ru;
- keepalive_requests 10000;
- # No Logging for loopback requests
- access_log off;
- location / {
- proxy_bind 1.1.1.1;
- proxy_pass https://https_example_ru;
- }
- }
- ### end of HTTPS config
Advertisement
RAW Paste Data
Copied
Advertisement