Skip to content

Commit

Permalink
updated scaling documentation to reflect new nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Feb 13, 2017
1 parent 5f035f3 commit adee6cf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 15 deletions.
28 changes: 21 additions & 7 deletions scaling/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,22 @@ blocks:
proxy_pass http://127.0.0.1:4567;
}

location ~ ^/(images|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
root /path/to/nodebb/public/;
try_files $uri $uri/ @nodebb;
location ~ ^/assets/(.*) {
root /path/to/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}

location /plugins/ {
root /path/to/nodebb/build/public/;
try_files $uri @nodebb;
}

location / {
proxy_pass http://io_nodes;
}

**Note**: This configuration is only applicable to NodeBB versions v1.4.3 and above.

Furthermore, you can instruct Nginx to serve these assets compressed:

gzip on;
Expand Down Expand Up @@ -105,16 +112,23 @@ Sample Nginx configuration with all of the above applied
proxy_pass http://io_nodes;
}

location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
root /path/to/nodebb/public/;
try_files $uri $uri/ @nodebb;
location ~ ^/assets/(.*) {
root /path/to/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}

location /plugins/ {
root /path/to/nodebb/build/public/;
try_files $uri @nodebb;
}

location / {
proxy_pass http://io_nodes;
}
}

**Note**: This configuration is only applicable to NodeBB versions v1.4.3 and above.

Configure Redis
---------------

Expand All @@ -126,7 +140,7 @@ as datastore and Redis for pubsub looks like this. When configured like
this Redis will also be used as the session store.

{
"url": "<http://example.org>",
"url": "http://example.org",
"secret": "your-secret-goes-here",
"database": "mongo",
"port": [4568,4569],
Expand Down
31 changes: 23 additions & 8 deletions scaling/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,23 @@ Your Nginx config will need to be modified add the following
proxy_pass http://127.0.0.1:4567;
}

location ~ ^/(images|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
root /path/to/nodebb/public/;
try_files $uri $uri/ @nodebb;
location ~ ^/assets/(.*) {
root /path/to/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}

location /plugins/ {
root /path/to/nodebb/build/public/;
try_files $uri @nodebb;
}

location / {
proxy_pass http://io_nodes;
}

**Note**: This configuration is only applicable to NodeBB versions
v1.4.3 and above.

Furthermore, you can instruct Nginx to serve these assets compressed:

::
Expand Down Expand Up @@ -97,7 +105,6 @@ Sample Nginx configuration with all of the above applied

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
Expand All @@ -116,16 +123,24 @@ Sample Nginx configuration with all of the above applied
proxy_pass http://io_nodes;
}

location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
root /path/to/nodebb/public/;
try_files $uri $uri/ @nodebb;
location ~ ^/assets/(.*) {
root /path/to/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}

location /plugins/ {
root /path/to/nodebb/build/public/;
try_files $uri @nodebb;
}

location / {
proxy_pass http://io_nodes;
}
}

**Note**: This configuration is only applicable to NodeBB versions
v1.4.3 and above.

Configure Redis
---------------

Expand All @@ -139,7 +154,7 @@ configured like this Redis will also be used as the session store.
::

{
"url": "<http://example.org>",
"url": "http://example.org",
"secret": "your-secret-goes-here",
"database": "mongo",
"port": [4568,4569],
Expand Down

0 comments on commit adee6cf

Please sign in to comment.