nginx try_files,对于nginx+uwsgi+django+前后端分离的配置
程序员文章站
2022-06-13 18:02:09
...
server {
listen 8993;
server_name erp.starmerx.com;
***location /{
alias /home/yf/erp_font/; #指向静态文件的目录
try_files $uri @proxy; #如果静态文件找不到就按照顺序依次访问,@proxy是下面定义的
}***
location @proxy {
proxy_pass http://127.0.0.1:9099;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Server;
}
}