본문 바로가기
반응형

linux26

nginx rewrite 설정 nginx에서 uri에서 특정 값을 포함하거나 파라미터에서 특정 값이 포함됐을때 다른 uri로 rewrite시키는 설정이다. nginx variable에 대한 설명은 아래 사이트에서 확인 가능하다. nginx.org/en/docs/http/ngx_http_core_module.html Module ngx_http_core_module Module ngx_http_core_module Directives Syntax: absolute_redirect on | off; Default: absolute_redirect on; Context: http, server, location This directive appeared in version 1.11.8. If disabled, redirects issued.. 2020. 6. 12.
diff를 이용한 파일 비교 diff를 이용하여 파일 내용을 비교할 수 있다. 스크립트를 통해서 파일내용이 다를때 처리를 할 수 있다. 파일 a aaaaa 파일 b bbbbb 파일 c aaaaa diff.sh echo "diff a b" diff a b DIFF_RESULT=$? echo "diff a b result : ${DIFF_RESULT}" if [ ${DIFF_RESULT} -eq "0" ] then echo "a and b are same files" else echo "a and b are differnt files" fi echo -e "\n\ndiff a c" diff a c DIFF_RESULT=$? echo -e "diff a c result : ${DIFF_RESULT}" if [ ${DIFF_RESULT} .. 2020. 5. 8.
redis 5.0.5 설치 기존에는 redis 2.6 버전을 사용하고 있었다. 해당 databse 를 백업하고 5.0.5버전으로 마이그레이션 하는 방법 #현재 메모리에 있는 db내용을 파일로 저장 redis-cli save # redis db파일 위치 확인 ls -l `redis-cli config get dir` dump.rdb 파일을 백업하고 새로 설치한 5.0.5 버전의 conf 파일에서 dir 항목과 dbfilename 항목을 확인 ex ) dir /var/redis/6379, dbfilename 6379_dump.rdb cp dump.rdb /var/lib/redis/6379/6379_dump.rdb 새로 설치한 redis를 시작하면 자동으로 마이그레이션 완료 redis 5.0.5를 설치해보자 방화벽 (centos 5.5.. 2019. 8. 20.
NGINX IP 필터링 NGINX 사용시 IP별로 접근 제한 방법 2가지 변수를 사용하여 필터링 ip가 192.168 로 시작하거나 127.0 으로 시작할때는 접근제한에 걸리지 않음.그 외의 ip는 /promotions 페이지로 이동uri가 /promotions 로 시작하는 경우에는 제한을 걸지 않음. server { server_name hulint.com;.. set $allow_ip false; if ( $remote_addr ~* "^192.168|^127.0"){ set $allow_ip true; } if ( $request_uri ~* "^/promotions" ) { set $allow_ip true; } if ( $allow_ip = false ) { rewrite ^ https://hulint.com/prom.. 2018. 6. 22.
반응형