Add reverse proxy
This commit is contained in:
parent
3207ea77d0
commit
57e853d16a
3 changed files with 11 additions and 1 deletions
|
@ -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:
|
||||
|
||||
|
|
2
index.js
2
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) {
|
||||
|
|
6
reverse-proxy.conf
Normal file
6
reverse-proxy.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue