-
Notifications
You must be signed in to change notification settings - Fork 18
nodeGame with Nginx
Nginx is an open source web server known for its efficiency and robustness. You can put "in front" of nodeGame to handle all incoming connections. Technically this is called a reverse proxy to nodeGame. Here are the steps to setup it.
-
Install Nginx following the instructions on their website.
-
Copy the Nginx default configuration file and save it under the correct location for your operating system:
- Linux/Mac:
/etc/nginx/sites-enabled/
. - Windows:
C:/nginx/conf/sites-enabled/
(more details)
- Linux/Mac:
-
Restart Nginx to load the new configuration.
-
Nginx is now listening on port 80, so you need to make sure nodeGame is listening to another port. Let's pick 8080, or whatever you have specified in the nginx conf file. Inside the nodeGame root directory edit the file:
conf/servernode.js
and set:
servernode.port = 8080;
-
Start nodeGame as usual, and it will now receive all the incoming connections from Nginx.
Read HTTPS wiki page for a guide how to setup Nginx to support SSL encryption.
Go back to the wiki Home.
Copyright (C) 2021 Stefano Balietti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.