NGINX
Nginx
0. What is nginx?
- client 가 외부 IP와 그 포트를 통해 server 에 접근하면,
- 그 때부터는 request 를 내부 IP 와 port 로 연결을 해주어야 한다.
- 일종의
proxy server
역할을 해주는 것이nginx
1. Install Nginx
2. Manage the Nginx Process
- nginx Process
3. Structure
/etc/nginx
- Nginx의 설정에 관련된 directory
/etc/nginx/nginx.conf
- nginx의
기본설정
파일,global
설정은 이 파일에서
- nginx의
/etc/nginx/sites-available/
- 포트 접속시 개별 설정하는 directory
- 여기 안에
default
파일 변경
4. Nginx Configuration
4.1 static file serving
/etc/nginx/sites-available/default
파일 수정
4.2 proxy server
- port 별로 설정이 가능하다
- 여러개의 포트를 연결
server {
listen 8080;
listen 80;
location / {
proxy_pass http://localhost:8080;
}
}