nginx. conf 학습
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
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.