Skip to content

Commit

Permalink
Update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
JongssLee committed Jul 23, 2024
1 parent b7e88e9 commit 809d055
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
server {
listen 80;
server_name localhost;
worker_processes 1;

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

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

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

location /api {
proxy_pass http://backend:8000; # Docker Compose에서 backend 서비스로 프록시
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;
}
location /api {
proxy_pass http://backend:8000; # Docker Compose에서 backend 서비스로 프록시
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;
}

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

0 comments on commit 809d055

Please sign in to comment.