log_format nodejs ‘$remote_addr - $remote_user [$time_local] - ’ ‘$http_host - “$request” $status $body_bytes_sent ’ ‘”$http_referer” “$http_user_agent” “$http_x_forwarded_for”’;
server { listen *:80 default_server; listen [::]:80 default_server ipv6only=on; server_name nodejs.org;
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; log_not_found off;
gzip on; gzip_disable “MSIE [1-6].”; gzip_types text/plain text/css application/javascript text/xml application/xml application/xml+rss image/svg+xml;
open_file_cache max=100000 inactive=300s; open_file_cache_valid 120s; open_file_cache_min_uses 2; open_file_cache_errors off;
root /home/www/nodejs; default_type text/plain; index index.html;
add_header Cache-Control “public, max-age=3600, s-maxage=14400”;
error_page 404 /404.html;
location ~ ^/(?!(dist/|dist$|.json$)) { rewrite ^ https://$host$uri permanent; }
location / { try_files $uri $uri/ =404;
location ~ .json$ { add_header access-control-allow-origin *; } }
location ^~ /dist { alias /home/dist/nodejs/release; autoindex on; default_type text/plain; open_file_cache_errors on;
location ~ .json$ { add_header access-control-allow-origin *; } } }
server { listen *:443 default_server ssl http2 backlog=4096; listen [::]:443 default_server ipv6only=on ssl http2 backlog=4096; server_name nodejs.org;
keepalive_timeout 60; server_tokens off; log_not_found off;
resolver 8.8.4.4 8.8.8.8 valid=300s; resolver_timeout 10s;
access_log /var/log/nginx/nodejs/nodejs.org-access.log nodejs; error_log /var/log/nginx/nodejs/nodejs.org-error.log;
gzip on; gzip_disable “MSIE [1-6].”; gzip_types text/plain text/css application/javascript text/xml application/xml application/xml+rss image/svg+xml;
open_file_cache max=100000 inactive=300s; open_file_cache_valid 120s; open_file_cache_min_uses 2; open_file_cache_errors off;
set $lang en;
root /home/www/nodejs; default_type text/plain; index index.html;
add_header Cache-Control “public, max-age=3600, s-maxage=14400”;
error_page 404 @localized_404;
location = / { rewrite ^ /en permanent; }
location / {
rewrite ^/(.*)/$ /$1 permanent;
try_files $uri $uri.html @english_fallback;
location ~ .json$ { add_header access-control-allow-origin *; } }
location /static { access_log off; log_not_found off; open_file_cache_errors on; }
location ^~ /_next { access_log off; log_not_found off; open_file_cache_errors on; }
location ^~ /dist { sendfile on; sendfile_max_chunk 1m; tcp_nopush on;
alias /home/dist/nodejs/release; autoindex on; default_type text/plain; open_file_cache_errors on;
rewrite ^/dist/staging/(.*)$ /dist/$1 permanent;
location ~ .json$ { add_header access-control-allow-origin *; } }
location ^~ /download { sendfile on; sendfile_max_chunk 1m; tcp_nopush on;
alias /home/dist/nodejs; autoindex on; default_type text/plain; open_file_cache_errors on;
add_header X-Robots-Tag noindex;
location ~ .json$ { add_header access-control-allow-origin *; } }
location ^~ /docs { alias /home/dist/nodejs/docs; autoindex on; default_type text/html;
location ~ .json$ { add_header access-control-allow-origin *; } }
location ^~ /api { alias /home/dist/nodejs/docs/latest/api; autoindex on; default_type text/plain;
location ~ .json$ { add_header access-control-allow-origin *; } }
location ^~ /documentation { rewrite ^/documentation/api(.*)$ /api$1 redirect; }
location ^~ /metrics { alias /home/dist/metrics; autoindex on; default_type text/plain; }
location @english_fallback {
if ($uri ~* ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/) { set $lang $1; }
rewrite ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/(.*)$ /en/$2; }
location @localized_404 {
add_header Cache-Control “private, no-store, max-age=0” always;
try_files /$lang/404.html /en/404.html =404; }
location = /traffic-manager { add_header Cache-Control “private, no-store, max-age=0” always;
access_log off; return 204; }
rewrite ^/.well-known/security.txt$ /security.txt last;
rewrite ^/about/security/?$ /~https://github.com/nodejs/node/blob/HEAD/SECURITY.md#security permanent; rewrite ^/contribute/?$ /en/get-involved permanent; rewrite ^/contribute/accepting_contributions.html$ /~https://github.com/nodejs/dev-policy permanent; rewrite ^/contribute/becoming_collaborator.html$ en/get-involved permanent; rewrite ^/contribute/code_contributions?$ /en/get-involved permanent; rewrite ^/contribute/code_contributions/workflow.html$ /en/get-involved permanent; rewrite ^/documentation(.*)$ /en/docs permanent; rewrite ^/foundation/blog.html$ /en/blog permanent; rewrite ^/images/foundation-visual-guidelines.pdf$ /static/documents/foundation-visual-guidelines.pdf permanent; rewrite ^/images/logos/js-black(.*)$ /static/images/logos/js-black$1 permanent; rewrite ^/images/logos/nodejs-(.*)$ /static/images/logos/nodejs-$1 permanent; rewrite ^/images/node-foundation-by-laws.pdf$ static/documents/node-foundation-by-laws.pdf permanent; rewrite ^/images.*trademark-policy.pdf$ /static/documents/trademark-policy.pdf permanent; rewrite ^/video(.*)$ /static/video$1 permanent; rewrite ^/changelog.html$ /~https://github.com/nodejs/node/blob/HEAD/CHANGELOG.md permanent; rewrite ^/api.html$ api permanent; rewrite ^/index.html$ en permanent; rewrite ^/(20\d\d\d\d/\d\d/.*)$ en/blog/$1 permanent; rewrite ^/about?$ en/about permanent; rewrite ^/about/releases?$ /~https://github.com/nodejs/release#release-schedule permanent; rewrite ^/en/about/releases/?$ /~https://github.com/nodejs/release#release-schedule permanent; rewrite ^/about/resources/?$ en/about/resources permanent; rewrite ^/about/security?$ /~https://github.com/nodejs/node/blob/HEAD/SECURITY.md#security permanent; rewrite ^/about/trademark/?$ en/about/trademark permanent; rewrite ^/blog?$ en/blog permanent; rewrite ^/community?$ /en/get-involved permanent; rewrite ^/en/security /~https://github.com/nodejs/node/blob/HEAD/SECURITY.md#security permanent; rewrite ^/en/docs/inspector/?$ /en/docs/guides/debugging-getting-started permanent;
rewrite ^/((atom|feed|rss)(|.xml)|(feed))$ /en/feed/blog.xml permanent; rewrite ^/feed/release?$ en/feed/releases.xml permanent; rewrite ^/feed/vulnerability?$ /en/feed/vulnerability.xml permanent;
rewrite ^/layouts/css/styles.css$ static/css/styles.css permanent; rewrite ^/(static)?favicon.ico$ static/images/favicons/favicon.png permanent; rewrite ^/(static)?favicon.png$ static/images/favicons/favicon.png permanent; rewrite ^/(static)?apple-touch-icon.*.png$ /static/images/favicons/favicon.png permanent; rewrite ^/trademark-policy.pdf$ /static/documents/trademark-policy.pdf permanent;
rewrite ^/logos/ static/images/logos permanent; rewrite ^/logos/monitor.png /static/images/logos/monitor.png permanent; rewrite ^/logos/nodejs(.*)$ /static/images/logos/nodejs$1 permanent;
rewrite ^/lfcollab.css$ /static/legacy/lfcollab.css permanent; rewrite ^/pipe.css$ /static/legacy/pipe.css permanent; rewrite ^/sh_javascript.min.js$ /static/legacy/sh_javascript.min.js permanent; rewrite ^/sh_main.js$ /static/legacy/sh_main.js permanent; rewrite ^/sh_vim-dark.css$ /static/legacy/sh_vim-dark.css permanent; rewrite ^/images/anchor.png /static/legacy/images/anchor.png permanent; rewrite ^/images/close-downloads.png /static/legacy/images/close-downloads.png permanent; rewrite ^/images/community-icons.png /static/legacy/images/community-icons.png permanent; rewrite ^/images/download-logo.png /static/legacy/images/download-logo.png permanent; rewrite ^/images/ebay-logo.png /static/legacy/images/ebay-logo.png permanent; rewrite ^/images/footer-logo-alt.png /static/legacy/images/footer-logo-alt.png permanent; rewrite ^/images/footer-logo.png /static/legacy/images/footer-logo.png permanent; rewrite ^/images/forkme.png /static/legacy/images/forkme.png permanent; rewrite ^/images/home-icons.png /static/legacy/images/home-icons.png permanent; rewrite ^/images/icons-interior.png /static/legacy/images/icons-interior.png permanent; rewrite ^/images/icons.png /static/legacy/images/icons.png permanent; rewrite ^/images/joyent-logo_orange_nodeorg-01.png /static/legacy/images/joyent-logo_orange_nodeorg-01.png permanent; rewrite ^/images/linkedin-logo.png /static/legacy/images/linkedin-logo.png permanent; rewrite ^/images/logo-light.png /static/legacy/images/logo-light.png permanent; rewrite ^/images/logo.png /static/legacy/images/logo.png permanent; rewrite ^/images/microsoft-logo.png /static/legacy/images/microsoft-logo.png permanent; rewrite ^/images/not-invented-here.png /static/legacy/images/not-invented-here.png permanent; rewrite ^/images/ryan-speaker.jpg /static/legacy/images/ryan-speaker.jpg permanent; rewrite ^/images/sponsored.png /static/legacy/images/sponsored.png permanent; rewrite ^/images/stripe.png$ /static/legacy/images/stripe.png permanent; rewrite ^/images/twitter-bird.png /static/legacy/images/twitter-bird.png permanent; rewrite ^/images/walmart-thumb.jpg$ /static/legacy/images/walmart-thumb.jpg permanent; rewrite ^/images/yahoo-logo.png /static/legacy/images/yahoo-logo.png permanent; rewrite ^/images/(.*) /static/images/$1 permanent;
rewrite ^/calendar$ https://calendar.google.com/calendar/embed?src=nodejs.org_nr77ama8p7d7f9ajrpnu506c98%40group.calendar.google.com permanent; rewrite ^/calendar.ics$ https://calendar.google.com/calendar/ical/nodejs.org_nr77ama8p7d7f9ajrpnu506c98%40group.calendar.google.com/public/basic.ics permanent;
rewrite ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/download/stable$ /$1/download/current permanent;
rewrite ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/docs/guides/debugging_getting_started/ /$1/docs/guides/debugging-getting-started permanent;
rewrite ^/download/v8.1.1/node-v8.1.1-headers.tar.gz$ /download/release/v8.1.1/node-v8.1.1-headers.tar.gz permanent; rewrite ^/download/v8.1.1/SHASUMS256.txt$ /download/release/v8.1.1/SHASUMS256.txt permanent;
rewrite ^/advisory-board /~https://github.com/nodejs/TSC permanent; rewrite ^/about/advisory-board /~https://github.com/nodejs/TSC permanent; rewrite ^/about/organization/?$ /~https://github.com/nodejs/TSC permanent; rewrite ^/about/organization/tsc-meetings /~https://github.com/nodejs/TSC/tree/HEAD/meetings permanent;
rewrite ^/(en|es|uk)/foundation/?$ https://foundation.nodejs.org/ permanent; rewrite ^/(en|uk)/foundation/case-studies/?$ https://openjsf.org/projects permanent; rewrite ^/(en|uk)/foundation/members/?$ https://openjsf.org/about/members permanent; rewrite ^/(en|uk)/foundation/board/?$ https://openjsf.org/about/governance permanent; rewrite ^/(en|uk)/foundation/tsc/?$ /~https://github.com/nodejs/TSC permanent; rewrite ^/(en|uk)/foundation/certification/?$ https://openjsf.org/certification permanent; rewrite ^/(en|uk)/foundation/in-the-news/?$ https://openjsf.org permanent; rewrite ^/(en|uk)/foundation/announcements/?$ https://openjsf.org/blog permanent; rewrite ^/(en|uk)/foundation/education/?$ https://openjsf.org/certification permanent; rewrite ^/foundation/?$ https://openjsf.org/ permanent; rewrite ^/foundation/members.html$ https://openjsf.org/about/members permanent;
rewrite ^/static/documents/casestudies/(.*)$ https://foundation.nodejs.org/wp-content/uploads/sites/50/2017/09/$1 permanent;
rewrite ^/static/documents/minutes/nodejs-foundation-board-meeting-(.*).pdf$ /~https://github.com/nodejs/board/blob/master/minutes/$1.md permanent; }
server { listen *:80; listen *:443 ssl http2; server_name www.nodejs.org;
return 301 https://nodejs.org$request_uri; }
server { listen *:80; listen *:443 ssl http2; server_name foundation.nodejs.org;
rewrite ^/wp-content/uploads/sites/50/2017/09/Node_CaseStudy_Nasa_FNL.pdf$ https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-NASA.pdf permanent; rewrite ^/wp-content/uploads/sites/50/2017/09/Node_CaseStudy_Fusion_Final.pdf$ https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-Fusion.pdf permanent; rewrite ^/wp-content/uploads/sites/50/2017/09/Node_CaseStudy_Walmart_final-1.pdf$ https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-Walmart.pdf permanent; rewrite ^/wp-content/uploads/sites/50/2017/09/Node_CaseStudy_HomeAway.pdf$ https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-HomeAway.pdf permanent; rewrite ^/wp-content/uploads/sites/50/2017/09/Node_CapitalOne_FINAL_casestudy.pdf$ https://openjsf.org/wp-content/uploads/sites/84/2020/02/Case_Study-Node.js-CapitalOne.pdf permanent;
rewrite ^ https://openjsf.org/ permanent; }
server { listen *:80; listen *:443 ssl http2; server_name blog.nodejs.org;
rewrite ^/\d+/\d+/\d+/(?:node-v(?:ersion-)?|version-)(\d+)[-.](\d+)[-.](\d+).*$ https://nodejs.org/en/blog/release/v$1.$2.$3 permanent;
rewrite ^/2015/05/16/node-leaders-are-building-an-open-foundation/$ https://nodejs.org/en/blog/community/node-leaders-building-open-neutral-foundation permanent; rewrite ^/2015/05/16/the-nodejs-foundation-benefits-all/$ https://nodejs.org/en/blog/community/foundation-benefits-all permanent; rewrite ^/2014/01/17/nodejs-road-ahead/$ https://nodejs.org/en/blog/nodejs-road-ahead permanent; rewrite ^/2013/12/03/bnoordhuis-departure/$ https://nodejs.org/en/blog/uncategorized/bnoordhuis-departure permanent; rewrite ^/2013/11/26/npm-post-mortem/$ https://nodejs.org/en/blog/npm/2013-outage-postmortem permanent; rewrite ^/2013/10/22/cve-2013-4450-http-server-pipeline-flood-dos/$ https://nodejs.org/en/blog/vulnerability/http-server-pipeline-flood-dos permanent; rewrite ^/2015/05/08/transitions/$ https://nodejs.org/en/blog/community/transitions permanent; rewrite ^/2015/05/08/next-chapter/$ https://nodejs.org/en/blog/community/next-chapter permanent; rewrite ^/2013/02/08/peer-dependencies/$ https://nodejs.org/en/blog/npm/peer-dependencies permanent; rewrite ^/2012/12/21/streams2/$ https://nodejs.org/en/blog/feature/streams2 permanent; rewrite ^/2012/09/30/bert-belder-libuv-lxjs-2012/$ https://nodejs.org/en/blog/video/bert-belder-libuv-lxjs-2012 permanent; rewrite ^/2012/05/08/bryan-cantrill-instrumenting-the-real-time-web/$ https://nodejs.org/en/blog/video/bryan-cantrill-instrumenting-the-real-time-web permanent; rewrite ^/2012/05/07/http-server-security-vulnerability-please-upgrade-to-0-6-17/$ https://nodejs.org/en/blog/vulnerability/http-server-security-vulnerability-please-upgrade-to-0-6-17 permanent; rewrite ^/2012/05/02/multi-server-continuous-deployment-with-fleet/$ https://nodejs.org/en/blog/module/multi-server-continuous-deployment-with-fleet permanent; rewrite ^/2012/04/25/profiling-node-js/$ https://nodejs.org/en/blog/uncategorized/profiling-node-js permanent; rewrite ^/2012/03/28/service-logging-in-json-with-bunyan/$ https://nodejs.org/en/blog/module/service-logging-in-json-with-bunyan permanent; rewrite ^/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/$ https://nodejs.org/en/blog/npm/managing-node-js-dependencies-with-shrinkwrap permanent; rewrite ^/2011/12/15/growing-up/$ https://nodejs.org/en/blog/uncategorized/growing-up permanent; rewrite ^/2011/10/26/version-0-6/$ https://nodejs.org/en/blog/uncategorized/version-0-6 permanent; rewrite ^/2011/10/05/an-easy-way-to-build-scalable-network-programs/$ https://nodejs.org/en/blog/uncategorized/an-easy-way-to-build-scalable-network-programs permanent; rewrite ^/2011/09/23/libuv-status-report/$ https://nodejs.org/en/blog/uncategorized/libuv-status-report permanent; rewrite ^/2011/09/08/ldapjs-a-reprise-of-ldap/$ https://nodejs.org/en/blog/uncategorized/ldapjs-a-reprise-of-ldap permanent; rewrite ^/2011/08/29/some-new-node-projects/$ https://nodejs.org/en/blog/uncategorized/some-new-node-projects permanent; rewrite ^/2011/08/12/the-videos-from-node-meetup/$ https://nodejs.org/en/blog/uncategorized/the-videos-from-node-meetup permanent; rewrite ^/2011/08/03/node-meetup-this-thursday/$ https://nodejs.org/en/blog/uncategorized/node-meetup-this-thursday permanent; rewrite ^/2011/07/11/evolving-the-node-js-brand/$ https://nodejs.org/en/blog/uncategorized/evolving-the-node-js-brand permanent; rewrite ^/2011/06/24/porting-node-to-windows-with-microsoft.+s-help/$ https://nodejs.org/en/blog/uncategorized/porting-node-to-windows-with-microsofts-help permanent; rewrite ^/2011/05/01/npm-1-0-released/$ https://nodejs.org/en/blog/npm/npm-1-0-released permanent; rewrite ^/2011/04/29/trademark/$ https://nodejs.org/en/blog/uncategorized/trademark permanent; rewrite ^/2011/04/28/node-office-hours-cut-short/$ https://nodejs.org/en/blog/uncategorized/node-office-hours-cut-short permanent; rewrite ^/2011/04/07/npm-1-0-link/$ https://nodejs.org/en/blog/npm/npm-1-0-link permanent; rewrite ^/2011/04/05/development-environment/$ https://nodejs.org/en/blog/uncategorized/development-environment permanent; rewrite ^/2014/12/05/listening-to-the-community/$ https://nodejs.org/en/blog/advisory-board/listening-to-the-community permanent; rewrite ^/2014/12/03/advisory-board-update/$ https://nodejs.org/en/blog/advisory-board/advisory-board-update permanent; rewrite ^/2011/03/25/jobs-nodejs-org/$ https://nodejs.org/en/blog/uncategorized/jobs-nodejs-org permanent; rewrite ^/2011/03/24/npm-1-0-global-vs-local-installation/$ https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation permanent; rewrite ^/2011/03/24/office-hours/$ https://nodejs.org/en/blog/uncategorized/office-hours permanent; rewrite ^/2011/03/18/npm-1-0-the-new-ls/$ https://nodejs.org/en/blog/npm/npm-1-0-the-new-ls permanent; rewrite ^/2011/03/18/welcome-to-the-node-blog/$ https://nodejs.org/en/blog/video/welcome-to-the-node-blog permanent; rewrite ^/2014/07/31/v8-memory-corruption-stack-overflow/$ https://nodejs.org/en/blog/vulnerability/v8-memory-corruption-stack-overflow permanent; rewrite ^/2014/07/29/building-nodejs-together/$ https://nodejs.org/en/blog/community/building-nodejs-together permanent; rewrite ^/2014/06/16/openssl-and-breaking-utf-8-change/$ https://nodejs.org/en/blog/vulnerability/openssl-and-utf8 permanent; rewrite ^/2014/06/11/notes-from-the-road/$ https://nodejs.org/en/blog/uncategorized/notes-from-the-road permanent;
rewrite ^/(feed/)?release/?$ https://nodejs.org/en/feed/releases.xml permanent; rewrite ^/(feed/)?vulnerability/?$ https://nodejs.org/en/feed/vulnerability.xml permanent; rewrite ^/(atom|feed|rss).*$ https://nodejs.org/en/feed/blog.xml permanent;
rewrite ^ https://nodejs.org/en/blog permanent; }