nginx. conf 학습

3056 단어 nginxechomac
더 읽 기
nginx 모듈
upstream-keepalive-nginx-module-0.3
openresty 에서 보증서, 긴 연결.유용 합 니 다.
그 echo 명령 을 주의 하 세 요. 그 변 수 를 모 르 면 인쇄 하 세 요.
mac 아래
echo - nginx - module 안에 echo 등 이 있어 요.
nginx_hello_월 드 는 스스로 쓴 것 이다.
ngx_devel_kit 는 set - misc - nginx 이래.
set - misc - nginx 는 매개 변 수 를 설정 하 는 setunescape_uri 등
./configure \
--with-debug \
--prefix=/Users/apple/Desktop/myfile/nginxtest/nginx \
--add-module=/Users/apple/Desktop/myfile/nginxtest/echo-nginx-module-0.37rc7/ \
--add-module=/Users/apple/Desktop/myfile/nginxtest/nginx_hello_world/ \
--add-module=/Users/apple/Desktop/myfile/nginxtest/ngx_devel_kit-0.2.17/ \
--add-module=/Users/apple/Desktop/myfile/nginxtest/set-misc-nginx-module-0.22rc3/  \
--with-cc-opt="-Wno-deprecated-declarations"

효과.
sh-3.2# curl http://localhost/testurl
hello anonymous!
sh-3.2# curl http://localhost/testurl?persion=heihei
hello heihei!
sh-3.2#
설정 파일:

location /hello {
            hello_world;
        }
#       location /foo {
#            set $a hello;
#            echo_exec /bar;
#        }
# 
#        location /bar {
#            echo "a = [$a]";
#        }
        location /foo {
            set $a hello;
            rewrite ^ /bar;
        }

        location /bar {
            echo "a = [$a]";
        }

        location /testurl {
            set_unescape_uri $persion $arg_persion;
            set_if_empty    $persion 'anonymous';
            echo 'hello $persion!';
        }
       location /merge {
            echo '[';
            echo_location_async /moon;
            echo ',';
            echo_location_async /earth;
            echo ']';
        }
        location /moon {
            echo '"moon"';
        }
        location /earth {
            echo '"earth"';
        }


$arg 사용 주의persion, url 뒤의 인자 persion 입 니 다.
curl http://localhost/testurl?persion=haha
curl http://localhost/merge
ab 로 누르다
sh-3.2# ab -n 1 http://localhost:80/testurl
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)...apr_socket_recv: Connection refused (61)
안 일어나 서 그래 요.
알 아파 ab 그냥 쓰 면 안 돼 요?
httpd
그 다음
그리고 ulimit - a
open file 이 충분 한 지 확인 하 세 요.
하면, 만약, 만약...  -n 10240
설치 httpload:http://www.acme.com/software/http_load/
http_load
- P 동시 다발 사용자 의 프로 세 스 수
- f 총 방문 횟수
- r 초당 방문 횟수
- s 총 방문 시간
url 은 파일 입 니 다.
내장http://localhost/testurl
http_load -rate 10 -second 3 url

좋은 웹페이지 즐겨찾기