개발 40

nginx proxy cache STALE 설정 - proxy_cache_use_stale

nginx proxy cache를 사용할 때 STALE이라는 상태값을 받을 때가 있다. stale이란 '신선하지 않은' 이라는 뜻으로, 응답이 정상적이지 않을 때, 이미 저장되어 있는 캐시를 대신 응답한다는 것을 의미한다. 어떤 경우에 STALE을 사용할지는 nginx.conf에서 설정할 수 있다. proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; proxy_cache_use_stale은 default off이기 때문에 stale인 케이스를 정의하고 싶다면 설정값을 입력만 하면 된다. 공식 문서는 여기 https://www.nginx.com/blog/nginx-caching-guid..

개발 2022.07.21

nginx 정규식 regex args에 변수명 설정하기 (variable capture)

먼저 아래 명령어로 PCRE 버전을 확인한다. rpm -qa | grep pcre PCRE-7.0 이상인 경우에 아래와 같이 사용할 수 있다. 정규식 내부 변수명을 설정할 영역을 (?(regex)) 또는 (?'name'(regex))로 감싸준다 아래와 같이 사용하면 page라는 변수명을 사용할 수 있게 된다 location ~ ^/my/(?(account|order))$ { proxy_pass http://to-proxy/user/$page$is_args$args; } 더 많은 내용을 알아보고 싶다면 variable capture in nginx 라는 검색어를 사용하면 된다. 공식 문서는 여기 http://nginx.org/en/docs/http/server_names.html#regex_names

개발 2022.07.21

Jmeter - jmx 파일 바로 열 수 있게 설정하기

jmeter로 테스트를 하려면 jmx 파일을 열면 되는데 이 jmx 파일은 따로 설정해주지 않으면 자동으로 Jmeter로 열리지 않는다. jmx 파일을 바로 열 수 있게 설정하는 법을 찾아보던 중 아래 링크를 발견했다 How to Open JMX Files on a Mac in 1 (Double) Click | BlazeMeter Learn to finally open a JMX file on your Mac machine by clicking. The guide you were looking for. Finally, a workaround for just clicking to open your JMX. www.blazemeter.com 1. Application - Automator를 연다. 아래 화면..

개발 2022.06.10

M1 맥북 모니터 연결시 멈춤 현상

기존 맥북이 발열+소음이 너무 심해서 결국 업무기기를 M1 맥북으로 바꾸게 되었다! 그런데 기존 맥북이랑은 전혀 문제가 없던 모니터가 M1 맥북을 연결하고 나니 자꾸 렉이 걸린것처럼 커서가 멈추고 화면도 멈추는 현상이 발생했다. 처음에는 그냥 기분탓이려니 했는데 기분 탓도 한두번이지 스크롤을 할 때마다 멈추니까 슬슬 성질이 나기 시작했다ㅋㅋㅋ 찾아보니까 external monitor laggy 라고 글이 많이 올라와 있기는 했다. 발견한 링크 https://forums.macrumors.com/threads/resolved-external-monitors-and-mouse-lag.2194467/ 여기서 보고 시도해봤던 것들 외부 모니터와 맥북의 디스플레이 > 디스플레이 설정 > 해상도를 둘다 해상도 조절..

개발 2022.05.24

github personal access token 발급하기

github 로그인을 한 뒤 아래 링크로 진입한다. 버튼으로 눌러서 들어간다면 프로필 > Settings > Developer settings > Personal access tokens 로 들어가면 된다. https://github.com/settings/tokens GitHub: Where the world builds software GitHub is where over 83 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat... github..

개발 2022.05.23

github repository를 못가져올때 - Support for password authentication was removed

git pull repository https://github.com/myrepo Username for 'https://github.com': myname Password for 'https://myname@github.com': Username과 Password를 잘 입력했는데 아래 메시지가 나온다면? Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. Password 란에 access token을 넣으면 된다. 그냥 personal access token을 쓰라고 해서 대체 토큰을 사용하려면 어떻게 해야 하는건가! 했는데 패스워드에 계정패스워드 대신 토..

개발 2022.05.23

M1 맥북 (Apple Silicon) npm install시 Only Mac 64 bits supported

M1맥북에 개발환경 세팅을 하면서 만난 이슈 기존에 사용하던 프로젝트에서 npm install을 하니 아래 에러가 발생했다 npm ERR! command failed npm ERR! command sh -c node install.js npm ERR! Only Mac 64 bits supported. 이전에 M1 사용하시는 다른 분이 M1 이슈로 node 14버전을 사용한다고 하셨던 게 생각나서 확인해보니 node 14버전을 사용해야 정상 동작을 한다고 한다. 처음 homebrew로 설치된 버전은 18버전이었고 혹시나 16버전으로 한번 내려봤는데 안돼서 14버전으로 두번 내렸다 먼저 install 가능한 버전을 확인해 본다. brew search node nodenode@14node@16 바로 14를 설..

개발 2022.05.23