Skip to content

nginx

Install the nginx package.

# apt update
# apt install nginx
# yum install epel-release
# yum install nginx
# yum install nginx

To serve the application, a new configuration file has to be created at /etc/nginx/conf.d/peering-manager.conf containing the following:

Debian specific

Debian also has the /etc/nginx/sites-enabled folder, where you can place your configuration files. It also places a default configuration there that you should remove.

server {
    listen 80;
    server_name peering.example.com;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwared-Proto $scheme;
        proxy_pass http://127.0.0.1:8001;
    }

    location /static {
        alias /opt/peering-manager/static;
    }
}
If you want to access Peering Manager on a path instead of root, you can alter the location statements accordingly. But you have also have to set the BASE_PATH setting to the same path.

After configuring, the nginx service has to be enabled and started:

# systemctl enable nginx --now

You now can access the application at the configured location. If you receive a 502 (bad gateway) error, your configuration may not be correct or the application server is not running.