multi pod 프로젝트 (e.g. react mono repo)에서 로컬 nginx 활용하기
로컬 개발시 로컬 nginx를 웹주소로 사용하면, multi pod 프로젝트에서 타 pod페이지 호출시, url pattern => rewrite로 내 pod는 로컬 node서버, 타 pod는 개발 web서버를 호출하는 등의 처리를 고려해 볼 만 하다. (browser domain을 고정시킬 수 있으므로)
로컬 개발시 로컬 nginx를 웹주소로 사용하면, multi pod 프로젝트에서 타 pod페이지 호출시, url pattern => rewrite로 내 pod는 로컬 node서버, 타 pod는 개발 web서버를 호출하는 등의 처리를 고려해 볼 만 하다. (browser domain을 고정시킬 수 있으므로)
포인트 웹 자원을 include 하는 구문 (href="/xxx", src="/xxx") 의 시작을 절대경로가 아닌 상대경로로 replace 해 주어서 해결함. 수정 전 (nginx > default.conf) … location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-NginX-Proxy true; proxy_pass http://tomcat; proxy_connect_timeout 5; } … 수정 후 (nginx > default.conf) … location /… Read More »
https://ialy1595.github.io/post/nginx-publish-in-same-domain/
* 개요 nginx 버전: 1.18.0 nginx – php 설정을 하는데, 기존 소스가 php 파일임에도 불구하고 html 확장자로 되어 있어서 초기 셋팅에 애를 먹었었다. location / {} 에 fast_cgi 관련 설정을 넣으니 <!DOCTYPE html> 태그가 html 파일에 선언되어 있을 때 css가 작동하지 않았고, 해당 태그를 삭제하니 css가 작동했다. 이 때 fiddler를 통해 좀 더 분석해 보니… Read More »