main
km0 2 years ago
parent 6b905c7432
commit 4a6ac0302f

@ -169,14 +169,15 @@ server {
root /var/www/html root /var/www/html
# ADD THIS SECTION # ADD FROM HERE
location /drw/ { location /drw/ {
proxy_pass http://localhost:3000/soupboat/drw/; proxy_pass http://localhost:3000/soupboat/drw/;
include proxy_params; include proxy_params;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
} # END OF SECTION }
# TO HERE
} }
``` ```
@ -185,7 +186,7 @@ The lines that you should edit according your configurations are:
- `location /drw/` - `location /drw/`
The name of the location _/drw/_ is up to you, and it's the address where the app will be served. In this case will be _hub.xpub.nl/soupboat/drw/_. The name of the location _/drw/_ is up to you, and it's the address where the app will be served. In this case will be _hub.xpub.nl/soupboat/drw/_.
- `proxy_pass http://localhost:3000/soupboat/drw/;` - `proxy_pass http://localhost:3000/soupboat/drw/;`
The very same name, as well as eventual prefixes, need to be specified in the line of _proxy_pass_. The very same name, as well as eventual prefixes, need to be specified in the line of _proxy pass_.
The port, in this example set to _3000_, it's the port where Express is mounting the application. By default is 3000, but you can edit it according to the configurations of the express server. The port, in this example set to _3000_, it's the port where Express is mounting the application. By default is 3000, but you can edit it according to the configurations of the express server.
The three `proxy_set_header` Host, Upgrade and Connection are necessary to make the Websocket connection work. The three `proxy_set_header` Host, Upgrade and Connection are necessary to make the Websocket connection work.

Loading…
Cancel
Save