/etc/nginx/sites-available/default 파일 수정
server {
.
.
.
location ^~ /api {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location ^~ /service {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
.
.
.
}
* /api 로 접근하거나, /service 로 접근하면 서버에서 받아 서버 로컬 8080으로 연결
'Server > Nginx' 카테고리의 다른 글
프록시 통해서 전달되는 svg 파일도 gzip 압축하여 전송 설정 (0) | 2024.06.06 |
---|---|
nginx 파일 업로드 최대 용량 제한 (0) | 2024.06.06 |
nginx gzip 설정 (웹사이트 컨텐츠 압축하여 전송) (0) | 2024.06.06 |
React를 위한 nginx 설치 및 세팅 (0) | 2024.06.06 |
무료 웹서버 인증서(let's encrypt) nginx 에 자동 설정하기 (2) | 2024.06.05 |