본문으로 건너뛰기

NGINX

개요​

NGINX에 대한 메모입니다.

listen = port server_name = domain location = url 해당 파일들을 미리생성에서 내용도 채워야함 nginx.conf / default.conf / index.html

예제·코드​

version: "3"

services:

nginx:
image: nginx:latest
volumes:
- ./templates:/etc/nginx/templates
- ./templates/nginx.conf:/etc/nginx/nginx.conf
- ./templates/default.conf:/etc/nginx/conf.d/default.conf
- ./templates/index.html:/usr/share/nginx/html/index.html
ports:
- "8080:80/tcp"
- "443:443"
environment:
- NGINX_HOST=127.0.0.1
- NGINX_PORT=80
- TZ=Asia/Seoul
server{
listen 80:
server_name sun.domain.com
location / {
proxy_pass http://127.0.0.1:8080
}
location /api {
proxy_pass http://127.0.0.1:8080
}
}

참고 자료