File size: 1,650 Bytes
d234e06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
server {
    listen 80;
    server_name YOUR_DOMAIN.com www.YOUR_DOMAIN.com;
    # λ˜λŠ” IP만 μ‚¬μš©: server_name YOUR_SERVER_IP;

    # 둜그 μ„€μ •
    access_log /var/log/nginx/soy-nv-ai-access.log;
    error_log /var/log/nginx/soy-nv-ai-error.log;

    # ν΄λΌμ΄μ–ΈνŠΈ μ΅œλŒ€ μ—…λ‘œλ“œ 크기 (100MB)
    client_max_body_size 100M;
    client_body_timeout 300s;
    client_header_timeout 300s;

    # ν”„λ‘μ‹œ 버퍼 μ„€μ •
    proxy_buffering off;
    proxy_request_buffering off;

    # ν”„λ‘μ‹œ μ„€μ •
    location / {
        proxy_pass http://127.0.0.1:5001;
        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;
        
        # WebSocket 지원
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        
        # νƒ€μž„μ•„μ›ƒ μ„€μ • (AI 응닡이 였래 걸릴 수 있음)
        proxy_connect_timeout 600s;
        proxy_send_timeout 600s;
        proxy_read_timeout 600s;
        
        # 버퍼 μ„€μ •
        proxy_buffer_size 128k;
        proxy_buffers 4 256k;
        proxy_busy_buffers_size 256k;
    }

    # 정적 파일 직접 제곡 (선택사항)
    location /static {
        alias /var/www/soy-nv-ai/static;
        expires 30d;
        add_header Cache-Control "public, immutable";
    }

    # λ³΄μ•ˆ 헀더
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-XSS-Protection "1; mode=block" always;
}