>  기사  >  백엔드 개발  >  nginx 리버스 프록시 및 정적 및 동적 분리

nginx 리버스 프록시 및 정적 및 동적 분리

WBOY
WBOY원래의
2016-08-08 09:24:37993검색

nginx 反向代理及动静分离

http { include MIME 유형; default_type 애플리케이션 옥텟 스트림; tcp_nopush 켜기; keepalive_timeout 65;업스트림 테스트{ s

http {
    include       mime.types;
    default_type  application/octet-stream;
    #tcp_nopush     on;
    keepalive_timeout  65;
업스트림 테스트{
    서버 192.168.1.203:80;
    서버 192.168.1.43:80;
}

    서버 {
        듣기       80;
        server_name  localhost;
        위치 / {
            루트   html;
            index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        위치 = /50x.html {
            루트   html;
        }
        위치 ~ .php$ {
            Proxy_pass   http://test;           后面不能加/http://test/是错误的
        }
 위치 ~ .*.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)${
         root /test/web;
         만료됨      3d;
    }

}    


以上就介绍了nginx는 反向代理及动静分离, 包括了方face的内容,希望对PHP教程有兴趣的朋友有所帮助.

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.