/etc/nginx/conf.d/
├── default.conf # 기본 설정 파일
├── example.com.conf # 특정 도메인의 설정
├── ssl.conf # SSL 관련 설정
└── front.conf # 프로젝트(front-react-3ds) 관련 설정
Nginx의 메인 설정 파일(/etc/nginx/nginx.conf)에는 보통 아래와 같은 내용이 포함되어 있습니다:
include /etc/nginx/conf.d/*.conf;
이는 conf.d 디렉토리 안의 .conf 확장자를 가진 모든 파일을 메인 설정에 포함시키겠다는 의미입니다.
conf.d 디렉토리에는 주로 아래와 같은 설정이 포함된다.
server {
listen 80;
server_name example.com;
location / {
root /var/www/example;
index index.html;
}
}
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/nginx/ssl/example.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
}
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
conf.d는 Nginx의 설정 파일을 저장하고 관리하는 표준 디렉토리. Nginx의 메인 설정 파일(/etc/nginx/nginx.conf)에서 conf.d/*.conf 파일들을 포함하므로, 특정 설정을 추가하거나 수정하려면 이 디렉토리에 위치한 .conf 파일을 편집하면 된다.
[root@iZmj75tpghvs5qi8mc3ff2Z front-react-3ds]# cd /etc/nginx/conf.d
[root@iZmj75tpghvs5qi8mc3ff2Z conf.d]#