mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
ported varnish docs
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
To be sure Varnish will work properly with NodeBB check that your configuration ```/etc/varnish/default.vcl``` is optimized for **websockets**.
|
Configuring Varnish Cache
|
||||||
|
==========================
|
||||||
|
|
||||||
```varnish
|
To be sure Varnish will work properly with NodeBB check that your configuration ``/etc/varnish/default.vcl`` is optimized for **websockets**.
|
||||||
backend nodebb {
|
|
||||||
|
.. code::
|
||||||
|
|
||||||
|
backend nodebb {
|
||||||
.host = "127.0.0.1"; # your nodebb host
|
.host = "127.0.0.1"; # your nodebb host
|
||||||
.port = "4567"; # your nodebb port
|
.port = "4567"; # your nodebb port
|
||||||
}
|
}
|
||||||
|
|
||||||
sub vcl_recv {
|
sub vcl_recv {
|
||||||
|
|
||||||
# Pipe websocket connections directly to Node.js
|
# Pipe websocket connections directly to Node.js
|
||||||
if (req.http.Upgrade ~ "(?i)websocket") {
|
if (req.http.Upgrade ~ "(?i)websocket") {
|
||||||
@@ -23,12 +27,11 @@ sub vcl_recv {
|
|||||||
return (pass); # don't cache
|
return (pass); # don't cache
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub vcl_pipe {
|
sub vcl_pipe {
|
||||||
# Need to copy the upgrade header
|
# Need to copy the upgrade header
|
||||||
if (req.http.upgrade) {
|
if (req.http.upgrade) {
|
||||||
set bereq.http.upgrade = req.http.upgrade;
|
set bereq.http.upgrade = req.http.upgrade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user