[프로젝트 구조 세팅]
This commit is contained in:
		
							
								
								
									
										38
									
								
								nginx-1.28.0/conf/nginx.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								nginx-1.28.0/conf/nginx.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
# ./nginx/nginx.conf
 | 
			
		||||
 | 
			
		||||
# 이벤트 블록은 Nginx가 어떻게 연결을 처리할지 정의합니다.
 | 
			
		||||
events {
 | 
			
		||||
    worker_connections 1024;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# HTTP 블록은 웹 서버의 동작을 정의합니다.
 | 
			
		||||
http {
 | 
			
		||||
    # MIME 타입 파일을 포함하여 파일 확장자에 따라 콘텐츠 타입을 결정합니다.
 | 
			
		||||
    include /etc/nginx/mime.types;
 | 
			
		||||
 | 
			
		||||
    # 기본 서버 설정을 정의합니다.
 | 
			
		||||
    server {
 | 
			
		||||
        # 80번 포트에서 요청을 받습니다.
 | 
			
		||||
        listen 80;
 | 
			
		||||
        server_name localhost; # 서버 이름을 localhost로 설정
 | 
			
		||||
 | 
			
		||||
        # 루트 경로(/)로 들어오는 모든 요청을 처리합니다.
 | 
			
		||||
        location / {
 | 
			
		||||
            # 요청을 다른 서버(여기서는 Nuxt.js)로 전달합니다.
 | 
			
		||||
            proxy_pass http://localhost:3000;
 | 
			
		||||
 | 
			
		||||
            # 프록시 헤더를 설정하여 원본 요청 정보를 유지합니다.
 | 
			
		||||
            proxy_set_header Host $host;
 | 
			
		||||
            proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        # /api/ 경로로 들어오는 요청을 처리합니다. (Spring Boot 컨테이너를 가리킨다고 가정)
 | 
			
		||||
        location /service {
 | 
			
		||||
            proxy_pass http://localhost:8080;
 | 
			
		||||
            proxy_set_header Host $host;
 | 
			
		||||
            proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user