巩固基础,砥砺前行 。
只有不断重复,才能做到超越自己。
能坚持把简单的事情做到极致,也是不容易的。
nginx简易
#配置负载均衡
upstream myaaa {
server localhost:8089;
server localhost:8099;
}
server {
listen 8085;
server_name localhost;
location /aa/ {
proxy_pass http://myaaa/;
}
}
# 配置反向代理
server {
listen 8083;
server_name localhost;
location /aa/ {
proxy_pass http://localhost:8089/;
}
}
# 配置动静分离
server {
listen 8084;
server_name localhost;
location / {
root D:\\software\\nginx-1.16.1\\html;
index index.html;
}
}
nginx配置静态资源访问遇到的小白问题
错误案例
listen 80;
server_name localhost;
location /dist/ {
root E:\\project\\handvoer\\front\\dist;
index index.html;
}
location /Pictures/ {
root C:\\Users\\DELL\\Pictures;
autoindex on;
}
正确案例
listen 80;
server_name localhost;
location /dist/ {
root E:\\project\\handvoer\\front;
index index.html;
}
location /Pictures/ {
root C:\\Users\\DELL;
autoindex on;
}