Skip to content

Commit

Permalink
Nginx负载均衡示例文件
Browse files Browse the repository at this point in the history
  • Loading branch information
mxd authored May 12, 2024
1 parent 7670fcc commit 0c5c4af
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions nginx/upstream-nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
upstream django {
ip_hash;
server 127.0.0.1:22200;
server 127.0.0.1:22201;
}
server
{
listen 80;
listen 443 ssl ;
server_name epg.mxdyeah.top;
root /mxdyeah/epg;
#DJANGO-SETTING-START
#Django 相关配置
location /{
include /www/server/nginx/nginx/conf/uwsgi_params;
uwsgi_pass django;
#uwsgi_pass 169.254.0.1:22200;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;

#proxy_pass http://django;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}

location /static {
alias /mxdyeah/epg/static;
#autoindex on;
}

location /banip {
alias /mxdyeah/epg/banip;
index index.html;
#autoindex on;
}

#location favicon.ico {
# alias /mxdyeah/epg/favcion.ico;
#}

#DJANGO-SETTING-END

access_log /dev/null;
error_log /epg/epg.mxdyeah.top.error.log;
}

0 comments on commit 0c5c4af

Please sign in to comment.