[Spring] 점프투 자바스프링부트

[Spring] 점프투 자바스프링부트

avatar
FrugalBoy
2024.12.03조회수 1회




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

회원가입만 해도
이 글을 무료로 읽을 수 있어요.

이미 계정이 있으신가요?로그인하기
댓글 0
avatar
FrugalBoy
구독자 5명구독중 10명
Wanna live like a frugal boy For the genetically superior, success is easier to attain. But it is by no means guaranteed. After all, there is no gene for fate -Gattaca-