Add nginx proxy for API endpoints - Contact form fully working

This commit is contained in:
Wind
2026-02-15 06:28:29 +09:00
parent 66e18d23c9
commit 63aec54418
4 changed files with 35 additions and 5 deletions

28
nginx.conf Normal file
View File

@@ -0,0 +1,28 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
# API 프록시
location /api/ {
proxy_pass http://hanmo-mail-contact:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}