diff --git a/README.md b/README.md index ae44ec6..83cd687 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ * Install node: `nvm install 18.12.1 && nvm use 18.12.1` * Install pm2: `npm install pm2 -g` * Install nginx: `sudo apt-get install nginx` +* Remove default virtual host: `sudo unlink /etc/nginx/sites-enabled/default` +* move conf: `sudo mv reverse-proxy.conf /etc/nginx/sites-available/` +* Enable site: `sudo ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf` +* restart nginx: `systemctl restart nginx` 2. Installation: diff --git a/index.js b/index.js index 04f6fb7..d861013 100644 --- a/index.js +++ b/index.js @@ -351,7 +351,7 @@ function makeid(length) { const start = async () => { try { - await fastify.listen({ port: 3000 , host: '0.0.0.0',}) + await fastify.listen({ port: 3000 , host: '127.0.0.1',}) } catch (err) { fastify.log.error(err) LDAP.close(function(err) { diff --git a/reverse-proxy.conf b/reverse-proxy.conf new file mode 100644 index 0000000..ea9f24d --- /dev/null +++ b/reverse-proxy.conf @@ -0,0 +1,6 @@ +server { + listen 80; + location / { + proxy_pass http://127.0.0.1:3000; + } +}