Skip to content

Commit

Permalink
build : update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeyo03 authored Nov 5, 2024
1 parent 19508d2 commit 8944aea
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,41 @@ user nginx;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 1024;
}

http {
# 기본 설정
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

# 서버 설정
server {
listen 3000;
server_name pocket4cut.link localhost;


# 기본 경로 설정
location / {
# 파일이 존재하지 않을 경우 루트 index.html 반환
try_files $uri $uri/ /index.html;
}

# /page/ 경로 요청 처리
location /page/ {
try_files $uri $uri/ /index.html;
}

# favicon.ico 요청을 따로 처리하여 루프 방지
location = /favicon.ico {
log_not_found off;
access_log off;
}

# 404 에러 페이지를 index.html로 리디렉션 (SPA 라우팅 해결)
error_page 404 /index.html;
location = /index.html {
internal;
}
}
}

0 comments on commit 8944aea

Please sign in to comment.