Skip to content

03. Reverse Proxy Setup

TurtIeSocks edited this page May 29, 2022 · 4 revisions

Nginx

This is a basic setup to get ReactMap running with Nginx. It is highly recommended you enable SSL (https) for production systems for both security and "locate me" feature. That is beyond the scope of this documentation and there are many ways to solve this.

Extra references:

Linux Setup

  • sudo apt-get update
  • sudo apt-get install nginx
  • sudo nano /etc/nginx/conf.d/default.conf
  • Copy and paste the below into the file
server {
    listen        80;
    listen        [::]:80;
    server_name   your_map_url.com;

    location / {
        proxy_pass              http://127.0.0.1:8080/;
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_request_buffering off;
        proxy_buffering         off;
        proxy_set_header        Connection keep-alive;
    }
}

Docker Setup

  • Uncomment the nginx section in the docker-compose.example.yml file
  • Create your config file - touch server/src/configs/nginx.conf
  • Copy and paste the below into the file
server {
    listen        80;
    listen        [::]:80;
    server_name   your_map_url.com;

    location / {
        proxy_pass              http://reactmap:8080/;
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_request_buffering off;
        proxy_buffering         off;
        proxy_set_header        Connection keep-alive;
    }
}

Apache

Awaiting contributions for how to setup Apache!

Clone this wiki locally