Skip to Content
Suffering builds character
아카이브8.Nginx특징정적 리소스 호스팅1. 정적 리소스 호스팅하기

1. 정적 리소스 호스팅하기

Nginx는 클라이언트에게 정적 리소스를 호스팅 할 수 있는 기능을 제공하는 웹 서버로 동작함

따라서 이러한 기능을 개발자가 테스트할 수 있도록 자체적인 디폴트 페이지(.html)를 제공함

1. 디폴트 페이지 접근하기

1-1. curl 명령어를 통해 CLI에서 접근 및 테스트

Terminal
curl localhost:80

실행 결과
Nginx의 index.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 nginx!</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-2. 브라우저를 통해 접근 및 테스트

Browser
http://localhost:80

실행 결과
Nginx의 index.html 파일이 브라우저를 통해 렌더링 되어 응답됨

Last updated on