Skip to content
This repository was archived by the owner on Mar 25, 2018. It is now read-only.

Commit e4b0959

Browse files
nginx: redirect * to https, except /dist & *.json
redirect everything on http://nodejs.org to their https counterparts, except dist and *.json tested using modified /etc/hosts: ``` curl -v http://nodejs.dev/dist/ curl -v http://nodejs.dev/dist curl -v http://nodejs.dev/distribution curl -v http://nodejs.dev/foobar curl -v http://nodejs.dev/foobar.json curl -v http://nodejs.dev/dist/123 curl -v http://nodejs.dev/foobar/lala.json ``` part of #68
1 parent e8a218d commit e4b0959

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

conf/nginx.conf

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ http {
2323
listen 80;
2424
server_name nodejs.org 8.12.44.238 www.nodejs.org;
2525

26-
### Re-enable after people update nvm and travis-ci updates?
27-
# location / {
28-
# rewrite ^ https://nodejs.org$request_uri permanent;
29-
# }
30-
3126
access_log /var/log/nginx/nodejs.access_log main;
3227
error_log /var/log/nginx/nodejs.error_log info;
3328

@@ -49,6 +44,12 @@ http {
4944
rewrite ^/documentation/api(.*)$ /api$1 permanent;
5045
}
5146

47+
# don't redirect dist to https as it breaks nvm/travis-ci
48+
# probably the same is true for json
49+
location ~ ^/(?!(dist/|dist$|\.json$)) {
50+
rewrite ^ https://nodejs.org$request_uri permanent;
51+
}
52+
5253
root /home/node/web/nodejs.org;
5354
}
5455

0 commit comments

Comments
 (0)