From 934dc3f9a4f81e1a620b4fd43cc3200f82c1a98d Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sat, 31 Dec 2016 18:51:54 +0700 Subject: [PATCH] #16: host old logs directly on our server --- ctor/etc/nginx/sites-available/default | 60 ++++++++++++++------------ 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/ctor/etc/nginx/sites-available/default b/ctor/etc/nginx/sites-available/default index 71754d6..0a33336 100644 --- a/ctor/etc/nginx/sites-available/default +++ b/ctor/etc/nginx/sites-available/default @@ -1,37 +1,41 @@ server { - listen 443 ssl; - server_name codingteam.org.ru; - keepalive_timeout 60; - ssl_certificate /etc/letsencrypt/live/loglist.net/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/loglist.net/privkey.pem; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "HIGH:!aNULL:!MD5:!kEDH"; - add_header Strict-Transport-Security 'max-age=15552000'; + listen 443 ssl; + server_name codingteam.org.ru; + keepalive_timeout 60; + ssl_certificate /etc/letsencrypt/live/loglist.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/loglist.net/privkey.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5:!kEDH"; + add_header Strict-Transport-Security 'max-age=15552000'; - location /_logs/ { - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_pass https://chatlogs.jabber.ru/; - } + location /_logs/ { + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_pass https://chatlogs.jabber.ru/; + } + location /old-logs/ { + alias /opt/codingteam/old-logs/; + index index.html; + } - location / { - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host codingteam.org.ru; - proxy_http_version 1.1; - proxy_pass http://localhost:5000/; - } + location / { + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host codingteam.org.ru; + proxy_http_version 1.1; + proxy_pass http://localhost:5000/; + } } server { - listen 80; - server_name codingteam.org.ru; + listen 80; + server_name codingteam.org.ru; - location / { - rewrite ^(.*)$ https://codingteam.org.ru$1 permanent; - } + location / { + rewrite ^(.*)$ https://codingteam.org.ru$1 permanent; + } }