Ubuntu에서 nginx 구조 확인 & index.html 수정하기

김해준's avatar
Apr 09, 2026
Ubuntu에서 nginx 구조 확인 & index.html 수정하기

1️⃣ nginx 설치 위치 찾기

find / -name nginx
notion image

✔ 의미

  • 시스템 전체에서 nginx 관련 경로 검색
  • 주요 경로 확인 가능
👉 대표 경로
/etc/nginx # 설정 파일 /usr/share/nginx # 정적 파일(html) /var/log/nginx # 로그

2️⃣ nginx 설정 폴더 확인

cd /etc/nginx
notion image

✔ 주요 파일

파일
역할
nginx.conf
메인 설정
sites-enabled
실제 적용되는 설정
sites-available
설정 템플릿

3️⃣ 파일 상세 정보 확인

ls
notion image
ls -l
notion image

✔ 해석

drwxr-xr-x
👉 의미
  • d → 디렉토리
  • rwx → 권한

4️⃣ index.html 위치 찾기

find / -name index.html
notion image

5️⃣ index.html 위치 이동

cd /usr/share/nginx/html ls
notion image
👉 기본 웹 페이지 파일 존재
index.html

6️⃣ index.html 내용 확인

cat index.html
notion image
👉 기본 내용
<h1>Welcome to nginx!</h1>

7️⃣ 파일 수정 준비 (nano 설치)

apt install nano
notion image

8️⃣ index.html 수정

nano index.html
notion image

✔ 수정 예시

<h1>Good Good</h1>

9️⃣ 저장 및 종료

👉 nano 저장 방법
Ctrl + O → Enter → Ctrl + X
또는
Ctrl + X → Y → Enter
notion image
notion image

🔟 결과 확인

👉 브라우저 접속
http://localhost:포트번호
notion image

🔥 핵심 개념 정리

1. nginx가 보는 파일 위치

👉 무조건 이거다
/usr/share/nginx/html/index.html

2. 구조 이해

경로
역할
/etc/nginx
설정
/usr/share/nginx/html
웹 페이지
/var/log/nginx
로그

3. Docker에서 중요한 포인트

👉 컨테이너 안에서 수정한 파일은
❗ 컨테이너 종료하면 사라진다
Share article