worker_processes 1;
events {
worker_connections 1024;
}
http {
##负载均衡测试的时候不要用浏览器测试,会有缓存!!!
upstream lyj{
server 127.0.0.1:8099 weight=1;
server 127.0.0.1:8088 weight=1;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name lyj.nginx;
location /static/img{
root D:/;
index index.html index.htm;
}
}
##server_name代表nginx的服务IP、端口,相当于127.0.0.1:80
##/代表所有的请求都会代理到下面的服务
server {
listen 80;
server_name lyj.controller;
location /{
proxy_pass http://lyj;
proxy_set_header Host $host;
index index.html index.htm;
}
}
}
nginx--学习记录
最新推荐文章于 2024-09-22 03:26:48 发布