Heim >Backend-Entwicklung >PHP-Tutorial >Nginx-Reverse-Proxy und statische und dynamische Trennung
nginx 反向代理及动静分离
http { include mimetypes; default_type Anwendungs-Oktett-Stream; tcp_nopush on; keepalive_timeout 65;upstream test{ s
http {
include mime.types;
default_type application/octet-stream;
#tcp_nopush on;
keepalive_timeout 65;
Upstream-Test{
Server 192.168.1.203:80;
Server 192.168.1.43:80;
}
Server {
hören . 80;
Servername localhost;
{
location = /50x.html {
root html;
}
location ~ .php$ {
Proxy_pass http://test; 后面不能加/http://test/是错误的
}
location ~ .*.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)${ root /test/web;
expires 3d;
}
}
以上就介绍了nginx 反向代理及动静分离, 包括了方面的内容, 希望对PHP教程有兴趣的朋友有所帮助。