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

Commit

Permalink
nginx: redirect * to https, except /dist & *.json
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robertkowalski committed Feb 28, 2015
1 parent e8a218d commit e4b0959
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions conf/nginx.conf
Expand Up @@ -23,11 +23,6 @@ http {
listen 80;
server_name nodejs.org 8.12.44.238 www.nodejs.org;

### Re-enable after people update nvm and travis-ci updates?
# location / {
# rewrite ^ https://nodejs.org$request_uri permanent;
# }

access_log /var/log/nginx/nodejs.access_log main;
error_log /var/log/nginx/nodejs.error_log info;

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

# don't redirect dist to https as it breaks nvm/travis-ci
# probably the same is true for json
location ~ ^/(?!(dist/|dist$|\.json$)) {
rewrite ^ https://nodejs.org$request_uri permanent;
}

root /home/node/web/nodejs.org;
}

Expand Down

0 comments on commit e4b0959

Please sign in to comment.