Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7207055
  • 博文数量: 510
  • 博客积分: 12019
  • 博客等级: 上将
  • 技术积分: 6836
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-01 16:46
文章分类

全部博文(510)

文章存档

2022年(2)

2021年(6)

2020年(59)

2019年(4)

2018年(10)

2017年(5)

2016年(2)

2015年(4)

2014年(4)

2013年(16)

2012年(47)

2011年(65)

2010年(46)

2009年(34)

2008年(52)

2007年(52)

2006年(80)

2005年(22)

分类: 系统运维

2018-10-27 12:01:38



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
阅读(1881) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~