본문 바로가기
Infra/Ubuntu

[Ubuntu; 우분투] Ubuntu 22.04 Nginx 설치

by daddydontsleep 2024. 1. 19.
728x90
728x90

사진: Unsplash 의 Janosch Diggelmann

Nginx 설치

sudo apt update
sudo apt install nginx

방화벽

sudo ufw app list

ufw 가 없는 경우 따로 설치를 해야합니다.

sudo ufw app list

Nginx에는 세가지 프로필이 있습니다.

1. Nginx Full : 이 프로필은 80번 포트(일반적인 암호화되지 않은 웹 트래픽)와 443번 포트(TLS/SSL 암호화 트래픽) 모두를 엽니다.

2. Nginx HTTP : 이 프로필은 오직 80번 포트(일반적인 암호화되지 않은 웹 트래픽)만 엽니다.

3. Nginx HTTPS : 이 프로필은 오직 443번 포트(TLS/SSL 암호화 트래픽)만 엽니다.

# 8080만 열기
sudo ufw allow 'Nginx HTTP'
# 상태 확인하기
sudo ufw status

상태 확인 및 조작

# 상태 확인
systemctl status nginx
# 멈춤
sudo systemctl stop nginx
# 시작
sudo systemctl start nginx
# 재시작
sudo systemctl restart nginx
# configuration 변경 시 서버가 꺼지지않고 반영하기
sudo systemctl reload nginx
# 자동 시작 멈춤
sudo systemctl disable nginx
# 자동 시작
sudo systemctl enable nginx

끝.

[reference]

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04

 

DigitalOcean | Cloud Hosting for Builders

Simple, scalable cloud hosting solutions built for small and mid-sized businesses.

www.digitalocean.com

 

728x90
300x250