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

首頁 > 服務器 > Web服務器 > 正文

openstack共享80、443端口的實例代碼

2024-09-01 13:54:15
字體:
來源:轉載
供稿:網友

前言

因為openstack使用的是apache,所以不能共享80端口,但創建的許多云主機,雖然可以通過rinetd進行跳轉,但有時需要直接訪問80端口,所以這里我們選擇包含了nginx的openrety。

1.1. 安裝 openresty

1. 向 centos 系統中添加 openresty 倉庫

#yum install yum-utils#yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

2. 安裝軟件包

#yum install openresty

3. 安裝命令行工具

#yum install openresty-resty

1.2. 配置 openresty

1. 進入 nginx 目錄

#cd /usr/local/openresty/nginx/conf/

2. 編輯 nginx 配置文件

#vi nginx.confuser root;worker_processes 12;error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid  logs/nginx.pid;events { worker_connections 10240;}http { include  mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '      '$status $body_bytes_sent "$http_referer" '      '"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main; sendfile  on; #tcp_nopush  on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; include conf.d/*; server {  listen  80;  #  server_name 域名;  #指定日志路徑  access_log logs/access.log main;  error_log logs/error.log;  #   location / {   proxy_pass http://172.17.17.113;  } }}

3. 在當前目錄下創建 conf.d 文件夾

#mkdir /usr/local/openresty/nginx/conf/conf.d#cd conf.d

4. 創建要被讀取的文件,目前定義為每臺機器創建一臺,這里定義添加一臺 aa 機器,則創建 aa.conf 。

#vi aa.confserver { listen  80;#綁定https include /usr/local/openresty/nginx/https/https.conf;#綁定域名 server_name 域名;#指定日志路徑 access_log logs/ope.access.log main; error_log logs/ope.error.log;#指定通過域名跳轉端口 location / {  proxy_pass http://172.17.17.136:8081; }}

1.3.  使用 openresty

1. 檢測 nginx 是否配置正確

#openresty -tnginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test is successful

2. 重載 openresty

#openresty -s reload

3.驗證

在瀏覽器上輸入綁定的域名即可直接訪問80或者所需端口。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。


注:相關教程知識閱讀請移步到服務器教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌鲁木齐市| 安龙县| 日土县| 黄石市| 云阳县| 汽车| 龙陵县| 南召县| 新民市| 惠水县| 汝州市| 湾仔区| 新闻| 阿拉尔市| 襄汾县| 新平| 丁青县| 奉贤区| 中宁县| 晋州市| 富锦市| 星座| 巴东县| 玉田县| 新丰县| 齐齐哈尔市| 罗田县| 夹江县| 西吉县| 舒城县| 上杭县| 突泉县| 都兰县| 海淀区| 海林市| 长泰县| 酒泉市| 鞍山市| 运城市| 富源县| 碌曲县|