Nginx转发后端配置
server {
#listen 8822;
listen 443 ssl;
server_name abc.XXX.com; #同个端口443可配置多个,也就是按照域名转发
ssl_certificate /root/xcx/certificate/ybw/full_chain.pem;
ssl_certificate_key /root/xcx/certificate/ybw/private.key;
#django
location / {
proxy_pass
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ‘upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#静态转发。图片、文件等
location ~ .*\.(webp|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
#location /cdn/ {
#root /root/xcx/certificate/ybw;
#autoindex on;
#expires 1d;
proxy_pass
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ‘upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
nginx -t
nginxt -s reload
阅读(1925) | 评论(0) | 转发(0) |