[변경스크립트]
#!/usr/bin/env sh
set -eu
# 템플릿 파일 ‘/etc/nginx/conf.d/default.conf.template’ 의 내용 중 ‘${API_HOST}’와 ‘${API_PORT}’ 의 값 을 os변수의 값으로 치환하고, ‘/etc/nginx/conf.d/default.conf’으로 생성
envsubst ‘${API_HOST} ${API_PORT}’ < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.confexec “$@”
[Template]
server {
listen 8080;
server_name localhost;#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}location /api {
proxy_pass http://${API_HOST}:${API_PORT};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
dd