wiki-js/home/server/nginx.md

1.0 KiB

title, description, published, date, tags, editor, dateCreated
title description published date tags editor dateCreated
nginx true 2025-09-27T17:47:20.076Z markdown 2025-09-27T13:50:53.553Z

nginx

Used for reverse proxy.

Functions:

  • route wiki.home -> 192.168.1.101:3000

Setup

The config files for each service is located at

/etc/nginx/sites-available/

Example config file wiki:

server {
    listen 80;
    server_name wiki.home;

    location / {
        proxy_pass http://192.168.1.101:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Add symlink to the config file so nginx loads it. This was it is easy to control which sites should be enabled or not by removing/adding the symlink.

sudo ln -s /etc/nginx/sites-available/wiki /etc/nginx/sites-enabled/

Start it with

sudo nginx -t

Check its status with

sudo systemctl status nginx