1.下载Nginx,配置nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream frontends {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location ^~ /static/ {
root D:\PythonProject\django_web;
if ($query_string) {
expires max;
}
}
location ^~ /media/ {
root D:\PythonProject\django_web;
if ($query_string) {
expires max;
}
}
location = /favicon.ico {
rewrite (.*) /static/favicon.ico;
}
location = /robots.txt {