JSCODE Logo
JSCODE 박재성JSCODE 제이온JSCODE 시니
온라인 강의프로그래밍 과외책/전자책무료 강의
유튜브블로그
후기
완강 후기 이벤트블로그 리뷰 이벤트AWS SAA 합격 후기 이벤트
회사명 : JSCODE대표 : 박재성사업자 등록번호 : 244-22-01557통신판매업 : 제 2023-인천미추홀-0381 호

서울특별시 구로구 경인로 20가길 11(오류동, 아델리아)

Copyright ⓒ 2026 JSCODE - 최상위 현업 개발자들의 프로그래밍 교육 All rights reserved.

이용약관개인정보처리방침

비전공자도 이해할 수 있는 Nginx 입문/실전

Nginx 기본 개념

Nginx를 왜 배우는 걸까?
Apache 쓰면 안 되나요? 왜 굳이 Nginx를 써야 되는거죠?

Nginx 설치 및 실행

AWS EC2 인스턴스 생성하기
[공부 Tip] 리눅스 명령어를 잘 모르시는 분들을 위한 공부 방법
Nginx 설치 및 실행하기
Nginx 로그 확인하는 방법

Nginx를 활용해 웹 사이트 배포하기

웹 서버(Web Server)란?
[보충 자료] vim 사용법
Nginx 기본 문법 해석하기
[실습] Nginx 기본 문법 응용해보기 - 1
[실습] Nginx 기본 문법 응용해보기 - 2
[보충 강의] Nginx 디버깅 방법
[실습] 웹 프론트엔드 프로젝트(HTML, CSS, JS) 배포하기
[실습] 웹 프론트엔드 프로젝트(React + Vite) 배포하기
[실습] 웹 프론트엔드 프로젝트(Next.js) 배포하기

한 서버에서 다른 도메인을 가진 여러 웹 사이트 배포하기 (멀티 도메인)

한 서버에서 다른 도메인을 가진 여러 웹 사이트를 배포하려면?!
[실습] 무료 도메인 구매 후 EC2에 연결하기
[실습] 하나의 EC2에서 여러 웹 사이트 배포하기

Nginx를 활용한 HTTPS 적용시키기

HTTPS를 왜 적용시켜야 할까?
[실습] Nginx, Certbot을 활용해 HTTPS 적용시키기
Nginx, Certbot이 작성한 HTTPS 관련 코드 해석하기
[보충 강의] 설정 파일 분리해서 관리하기 (include)

리버스 프록시(Reverse Proxy)를 활용해 백엔드 서버 배포하기

리버스 프록시(Reverse Proxy)란?
[실습] 리버스 프록시를 활용해 Spring Boot 서버 배포하기
[실습] Spring Boot 서버에 도메인 적용하기
[실습] Spring Boot 서버에 HTTPS 적용하기
[실습] IP당 요청 수 제한하기

Nginx를 로드 밸런서(Load Balancer)로 사용하기

로드 밸런서(Load Balancer)란?
[실습] 하나의 EC2에서 백엔드 서버 2개를 로드 밸런싱 시키기
← 블로그 목록으로 돌아가기

[실습] Nginx 기본 문법 응용해보기 - 1

JSCODE 박재성
JSCODE 박재성
2026. 04. 02.
author
JSCODE 박재성
category
Nginx
createdAt
Dec 6, 2025 12:44 PM
isPublic
isPublic
series
비전공자도 이해할 수 있는 Nginx 입문/실전
slug
nginx-config-practice-1
type
post
updatedAt
Apr 2, 2026 09:00
👨🏻‍🏫
기본 문법을 해석하고 정리했다면 하나씩 바꿔가면서 응용해봐야 한다. 이렇게도 가지고 놀아보고, 저렇게도 가지고 놀아봐야 한다. 그러면서 코드를 하나씩 수정하면서 의도한대로 작동하는 지 눈으로 확인하는 작업을 반드시 거쳐야 한다. 이렇게 학습하면 정말 빠르게 배울 수 있다.
 

✅ Nginx 기본 웹 사이트 수정해보기

  1. 설정 파일 확인하기
    1. $ cd /etc/nginx/conf.d/default.conf
       
      /etc/nginx/conf.d/default.conf
      server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } # / 으로 시작하는 모든 경로를 처리 (ex. /index.html) location / { # /jscode.html로 요청이 들어오면 /usr/share/nginx/html/jscode.html 파일로 응답 root /usr/share/nginx/html; # /로 요청이 들어오면 /usr/share/nginx/html/index.html로 응답 # 만약 /usr/share/nginx/html/index.html이 없을 경우, /usr/share/nginx/html/index.htm으로 응답 index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
       
  1. 기존 웹 페이지 접속해보기
    1. http://{EC2 IP 주소}로 접속해보자.
      notion image
       
  1. 기본 웹 페이지 수정하기
    1. $ cd /usr/share/nginx/html $ sudo vi index.html
       
      /usr/share/nginx/html/index.html
      <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to JSCODE!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
       
  1. 웹 페이지가 수정됐는 지 확인하기
    1. http://{EC2 IP 주소}로 접속해보자.
      notion image
 
 

✅ Nginx 에러 페이지 수정해보기

  1. 설정 파일 확인하기
    1. $ cd /etc/nginx/conf.d/default.conf
       
      /etc/nginx/conf.d/default.conf
      server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; # /50x.html과 완전히 일치하는 경로를 처리 location = /50x.html { # /50x.html로 요청이 들어오면 /usr/share/nginx/html/50x.html 파일로 응답 root /usr/share/nginx/html; } }
       
  1. 기존 에러 페이지 접속해보기
    1. notion image
       
  1. 기본 에러 페이지 수정하기
    1. $ cd /usr/share/nginx/html $ sudo vi 50x.html
       
      /usr/share/nginx/html/50x.html
      <!DOCTYPE html> <html> <head> <title>Error</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Error!</h1> <p>Sorry, the page you are looking for is currently unavailable.<br/> Please try again later.</p> <p>If you are the system administrator of this resource then you should check the error log for details.</p> <p><em>Faithfully yours, nginx.</em></p> </body> </html>
       
  1. 에러 페이지가 수정됐는 지 확인하기
    1. http://{EC2 IP 주소}/50x.html로 접속해보자.
      notion image
 
 
 
 
📎
이 글은 비전공자도 이해할 수 있는 Nginx 입문/실전 강의의 수업 자료 중 일부입니다.