Skip to content

Deployment With Nginx

PunitTailor55 edited this page Sep 20, 2020 · 9 revisions

Root the Box works well with Nginx for larger games. There is a basic Nginx config file located in the setup/ directory.

Set the x_headers = True in the rootthebox.cfg (allows the real IP to be read - necessary for admin ip filtering)

In order to tell nginx to reverse proxying the rootthebox server you have to:

  1. Add the nginx_vhost_rtb.conf file located in the setup/ directory in the sites-available/ folder of NGINX Server
  2. Adapt the nginx_vhost_rtb.conf file and modify the lines server_name <server_name>; with your server name and root <PATH of RTB location>; with where your RTB Server is
  3. Execute the command ln -s /etc/nginx/sites-available/nginx_vhost_rtb.conf /etc/nginx/sites-enabled/
  4. Insert these lines in the nginx.conf in the http{} block at the end
sendfile on;
server_tokens off;

gzip              on;
gzip_http_version 1.0;
gzip_proxied      any;
gzip_min_length   500;
gzip_disable      "MSIE [1-6]\.";
gzip_types        text/plain text/xml text/css
                  text/comma-separated-values
                  text/javascript
                  application/x-javascript
                  application/atom+xml;

map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
}

# Configuration containing list of application servers
# As of now we only use one process for the main app
upstream rtb_server {
       server 127.0.0.1:8888;
}
  1. Restart NGINX server

Note : In nginx.conf include /usr/local/etc/nginx/mime.types; File location would be different. Please check your mime type file location.

Clone this wiki locally