国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

nginx http重定向https配置說(shuō)明

2024-08-30 12:25:41
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

nginx http重定向https配置說(shuō)明

現(xiàn)在什么蘋(píng)果,谷歌瀏覽器請(qǐng)求地扯基本都要求使用https了,如何把原來(lái)的http協(xié)議重定向到https中呢,這里我們可以使用http反向代理軟件nginx。

使用

安裝

yum install nginx -y

配置

cat /etc/nginxserver { listen 80; server_name dounine.com www.dounine.com; return  301 https://www.dounine.com$request_uri;}server { listen 443; server_name dounine.com dounine.com; return  301 https://www.dounine.com$request_uri;}server { listen 443; server_name www.dounine.com; ssl on; ssl_certificate /etc/nginx/dounine.crt; ssl_certificate_key /etc/nginx/dounine.key; location / { client_max_body_size 20m; proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }}

以上配置可將www.dounine.com、dounine.com與https://dounine.com 重定向至https://www.dounine.com地扯中。

注意

記得將防火墻的80與443端口打開(kāi)。

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 枝江市| 黄梅县| 新沂市| 佳木斯市| 大冶市| 桃源县| 永康市| 宜阳县| 葫芦岛市| 康马县| 库伦旗| 金坛市| 北辰区| 东光县| 社会| 景东| 夏河县| 水富县| 南康市| 屯门区| 进贤县| 镇康县| 东乡族自治县| 民县| 科技| 辽宁省| 抚州市| 阜康市| 涞源县| 迁安市| 海丰县| 冕宁县| 沐川县| 石狮市| 铁岭县| 旅游| 砚山县| 遵化市| 浑源县| 成武县| 宜城市|