Skip to content

Commit

Permalink
nginx logs in subdirectories, swap spdy for http2
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 12, 2016
1 parent 7b8b442 commit d299f1b
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
22 changes: 4 additions & 18 deletions setup/www/resources/config/benchmarking.nodejs.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,13 @@ server {
}

server {
listen [::]:443 ssl spdy;
listen *:443 ssl spdy;
listen [::]:443 ssl http2;
listen *:443 ssl http2;
server_name benchmarking.nodejs.org;

ssl_certificate ssl/nodejs_chained.crt;
ssl_certificate_key ssl/nodejs.key;
ssl_trusted_certificate ssl/nodejs_chained.crt;
ssl_dhparam ssl/dhparam.pem;

ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_session_cache shared:benchmarking:100m;
ssl_session_timeout 24h;

ssl_stapling on;
ssl_stapling_verify on;

spdy_keepalive_timeout 300;
spdy_headers_comp 9;

keepalive_timeout 60;
server_tokens off;
Expand All @@ -38,8 +24,8 @@ server {
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

access_log /var/log/nginx/benchmarking.nodejs.org-access.log nodejs;
error_log /var/log/nginx/benchmarking.nodejs.org-error.log;
access_log /var/log/nginx/benchmarking/benchmarking.nodejs.org-access.log nodejs;
error_log /var/log/nginx/benchmarking/benchmarking.nodejs.org-error.log;

gzip on;
gzip_static on;
Expand Down
12 changes: 6 additions & 6 deletions setup/www/resources/config/iojs.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ server {
}

server {
listen [::]:443 ssl spdy;
listen *:443 ssl spdy;
listen [::]:443 ssl http2;
listen *:443 ssl http2;
server_name www.iojs.org;

ssl_certificate ssl/iojs_chained.crt;
Expand All @@ -18,8 +18,8 @@ server {
}

server {
listen [::]:443 ssl spdy;
listen *:443 ssl spdy;
listen [::]:443 ssl http2;
listen *:443 ssl http2;
server_name iojs.org;

ssl_certificate ssl/iojs_chained.crt;
Expand All @@ -36,8 +36,8 @@ server {
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

access_log /var/log/nginx/iojs.org-access.log nodejs;
error_log /var/log/nginx/iojs.org-error.log;
access_log /var/log/nginx/iojs/iojs.org-access.log nodejs;
error_log /var/log/nginx/iojs/iojs.org-error.log;

gzip on;
gzip_static on;
Expand Down
4 changes: 2 additions & 2 deletions setup/www/resources/config/libuv.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ server {
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

access_log /var/log/nginx/libuv.org-access.log nodejs;
error_log /var/log/nginx/libuv.org-error.log;
access_log /var/log/nginx/libuv/libuv.org-access.log nodejs;
error_log /var/log/nginx/libuv/libuv.org-error.log;

gzip on;
gzip_static on;
Expand Down
3 changes: 2 additions & 1 deletion setup/www/resources/config/logrotate-nginx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/var/log/nginx/*.log {
/var/log/nginx/*.log, /var/log/nginx/nodejs/*.log, /var/log/nginx/iojs/*.log, /var/log/nginx/libuv/*.log, /var/log/nginx/benchmarking/*.log {
daily
missingok
compresscmd /usr/bin/xz
Expand All @@ -13,6 +13,7 @@
dateyesterday
maxsize 500M
sharedscripts
rotate 36500
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
Expand Down
20 changes: 10 additions & 10 deletions setup/www/resources/config/nodejs.org
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ server {
listen [::]:80 default_server ipv6only=on;
server_name nodejs.org;

access_log /var/log/nginx/nodejs.org-access.log nodejs;
error_log /var/log/nginx/nodejs.org-error.log;
access_log /var/log/nginx/nodejs/nodejs.org-access.log nodejs;
error_log /var/log/nginx/nodejs/nodejs.org-error.log;

keepalive_timeout 60;
server_tokens off;
Expand Down Expand Up @@ -168,24 +168,24 @@ server {
}

server {
listen *:443 ssl spdy;
listen [::]:443 ssl spdy;
listen *:443 ssl http2;
listen [::]:443 ssl http2;
server_name www.nodejs.org;

return 301 https://nodejs.org$request_uri;
}

server {
listen *:443 ssl spdy;
listen [::]:443 ssl spdy;
listen *:443 ssl http2;
listen [::]:443 ssl http2;
server_name blog.nodejs.org;

return 301 http://blog.nodejs.org$request_uri;
}

server {
listen *:443 default_server ssl spdy;
listen [::]:443 default_server ipv6only=on ssl spdy;
listen *:443 default_server ssl http2;
listen [::]:443 default_server ipv6only=on ssl http2;

server_name nodejs.org;

Expand All @@ -199,8 +199,8 @@ server {
#add_header X-Frame-Options DENY;
#add_header X-Content-Type-Options nosniff;

access_log /var/log/nginx/nodejs.org-access.log nodejs;
error_log /var/log/nginx/nodejs.org-error.log;
access_log /var/log/nginx/nodejs/nodejs.org-access.log nodejs;
error_log /var/log/nginx/nodejs/nodejs.org-error.log;

gzip on;
gzip_static on;
Expand Down
3 changes: 0 additions & 3 deletions setup/www/resources/config/ssl-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ ssl_session_timeout 24h;

ssl_stapling on;
ssl_stapling_verify on;

spdy_keepalive_timeout 300;
spdy_headers_comp 9;
22 changes: 22 additions & 0 deletions setup/www/tasks/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
copy:
src: ./resources/config/ssl-defaults.conf
dest: /etc/nginx/conf.d/ssl-defaults.conf
tags: nginx

- name: nginx | Remove ssl_protocols from default nginx config
replace:
dest: /etc/nginx/nginx.conf
regexp: '^(\s+)ssl_protocols'
replace: '\1# ssl_protocols'
tags: nginx

- name: nginx | Install open file cache config
copy:
Expand Down Expand Up @@ -81,6 +89,20 @@
group: root
tags: nginx

- name: nginx | Make /var/log/nginx/ subdirectories
file:
path: '/var/log/nginx/{{ item }}'
state: directory
mode: 0755
owner: www-data
group: adm
with_items:
- 'nodejs'
- 'iojs'
- 'libuv'
- 'benchmarking'
tags: nginx

- name: nginx | Restart service
service:
name: nginx
Expand Down

0 comments on commit d299f1b

Please sign in to comment.