server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
아래는 코드에 대한 설명
우리의 개발코드는 8080포트에서 돌아감
그런데 우리는 nginx 를 이용해서 localhost:80으로 오는 request들을
localhost:8080으로 보냄. nginx는 여기서 reverse proxy라고 보면 됨
그래서 localhost의 ip주소인 http://52.14.160.27:80을 치면
자동으로 :8080으로 가게됨.
This specific setup is likely part of a web application deployment, where the application server (on port 8080) handles business logic, and NGINX acts as a gateway.
This configuration sets up an NGINX reverse proxy. NGINX acts as a gateway to another server running on localhost:8080. It is commonly used to:
https://chatgpt.com/share/674e9b54-7034-8009-9986-25ace4a64cb7

![[Spring] MVC란? 초중요 꼭 보기](https://velog.velcdn.com/images/0andwild/post/9802df2f-7404-4e6c-b91d-5916ae8786cb/image.png)
![[Springboot] Form data(폼 데이터)와 DTO 란?](https://velog.velcdn.com/images/dani0817/post/eb9cc833-8ce1-4ea4-b710-a54ff3f8405b/image.png)