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

首頁 > 網站 > Nginx > 正文

nginx http重定向https配置說明

2024-08-30 12:23:20
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了nginx http重定向https配置說明的相關資料,需要的朋友可以參考下

nginx http重定向https配置說明

現在什么蘋果,谷歌瀏覽器請求地扯基本都要求使用https了,如何把原來的http協議重定向到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端口打開。

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 米泉市| 定兴县| 东源县| 泾源县| 镇坪县| 德钦县| 邵武市| 泗洪县| 江川县| 醴陵市| 宾阳县| 布拖县| 边坝县| 黔西| 江华| 桐梓县| 峨眉山市| 通山县| 新泰市| 敦化市| 故城县| 余庆县| 内黄县| 天水市| 宜兴市| 修文县| 晴隆县| 儋州市| 石嘴山市| 泰州市| 潞城市| 宣城市| 武鸣县| 浮梁县| 修水县| 扎囊县| 都兰县| 梅河口市| 汤阴县| 丹巴县| 改则县|