51 lines
1.4 KiB
Nginx Configuration File
51 lines
1.4 KiB
Nginx Configuration File
# -------------------------------------------------------
|
|
# Orange Pi 5 전용 Nginx 설정 (HTTP only)
|
|
# SSL/도메인 처리는 상위 서버(5825u)에서 담당
|
|
# 외부 접근: 192.168.0.114:5700
|
|
# -------------------------------------------------------
|
|
|
|
events { worker_connections 1024; }
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
client_max_body_size 20M;
|
|
sendfile on;
|
|
access_log off;
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /var/www/html;
|
|
index index.html;
|
|
|
|
# QR 접속: /report/{charger_id} → report.html
|
|
location ~ ^/report/(.+)$ {
|
|
try_files /pages/report.html =404;
|
|
}
|
|
|
|
# API 프록시
|
|
location /api/ {
|
|
proxy_pass http://backend:8000;
|
|
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_read_timeout 60s;
|
|
}
|
|
|
|
# 업로드 파일 서빙
|
|
location /uploads/ {
|
|
alias /var/www/uploads/;
|
|
expires 7d;
|
|
}
|
|
|
|
# 정적 파일 (SPA 라우팅)
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|
|
}
|