server {
    listen       80;
    server_name  localhost;

   location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ /autoflow/index.html;
    }

    # 백엔드 API 프록시
    location /autoflow-server-mgmt/ {
		proxy_pass http://autoflow-server-mgmt-svc:80;

		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;

		# 타임아웃 연장
		proxy_connect_timeout 600s;
		proxy_send_timeout 600s;
		proxy_read_timeout 600s;
		send_timeout 600s;
	}


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}
