Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Latest commit

Β 

History

History
83 lines (56 loc) Β· 1.27 KB

File metadata and controls

83 lines (56 loc) Β· 1.27 KB

< λ’€λ‘œκ°€κΈ°

πŸŽ‰ Nginx

sudo -s
sudo apt-get update
sudo apt-get install nginx <!-- nginx.install.md -->
sudo service ngnix start <!-- nginx.start.md -->


πŸŽ‰ Install node

curl -s https://deb.nodesource.com/setup_16.x | sudo bash
sudo apt-get install -y nodejs


πŸŽ‰ Install pm2

sudo npm install -g pm2


πŸŽ‰ npm global list

npm ls -g

\

πŸŽ‰ Nginx Reverse Proxy μ„€μ • ν›„ μž¬λΆ€νŒ…

cd /etc/nginx/sites-enabled

ls
sudo rm default
sudo nano default

후에 λ‹€μŒ 파일 볡사 λΆ™μ—¬ λ„£κΈ° ν›„ Ctrl + S, Ctrl + X.

server {
        listen 80;
        listen [::]:80;

        access_log /var/log/nginx/reverse-access.log;
        error_log /var/log/nginx/reverse-error.log;

        location / {
                    proxy_pass http://127.0.0.1:3000;
  }
}

후에 λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ μ œλŒ€λ‘œ μ„€μ • λ˜μ—ˆλŠ”μ§€ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

sudo nginx -t

후에 λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ nginx 을 μž¬μ‹œμž‘ ν•  μžˆμŠ΅λ‹ˆλ‹€.

sudo service nginx restart