最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

openstack共享80、443端口的實(shí)例代碼

 更新時(shí)間:2018年03月21日 09:00:04   作者:yaohong  
這篇文章主要介紹了openstack共享80、443端口的實(shí)例代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

前言

因?yàn)閛penstack使用的是apache,所以不能共享80端口,但創(chuàng)建的許多云主機(jī),雖然可以通過rinetd進(jìn)行跳轉(zhuǎn),但有時(shí)需要直接訪問80端口,所以這里我們選擇包含了nginx的openrety。

1.1. 安裝 openresty

1. 向 centos 系統(tǒng)中添加 openresty 倉(cāng)庫(kù)

#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. 進(jìn)入 nginx 目錄

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

2. 編輯 nginx 配置文件

#vi nginx.conf
user 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. 在當(dāng)前目錄下創(chuàng)建 conf.d 文件夾

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

#cd conf.d

4. 創(chuàng)建要被讀取的文件,目前定義為每臺(tái)機(jī)器創(chuàng)建一臺(tái),這里定義添加一臺(tái) aa 機(jī)器,則創(chuàng)建 aa.conf 。

#vi aa.conf
server {
 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;

#指定通過域名跳轉(zhuǎn)端口
 location / {

  proxy_pass http://172.17.17.136:8081;

 }
}

1.3.  使用 openresty

1. 檢測(cè) nginx 是否配置正確

#openresty -t

nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test is successful

2. 重載 openresty

#openresty -s reload

3.驗(yàn)證

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

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

乌鲁木齐县| 萨迦县| 石渠县| 登封市| 浙江省| 福贡县| 繁峙县| 柘荣县| 黎平县| 酉阳| 敦化市| 高陵县| 乌拉特中旗| 盐亭县| 榆林市| 金昌市| 改则县| 庆阳市| 平利县| 防城港市| 白朗县| 浏阳市| 合水县| 青川县| 恩平市| 信宜市| 木兰县| 汪清县| 宜川县| 黔江区| 建阳市| 景德镇市| 凤城市| 巴里| 英吉沙县| 安乡县| 思南县| 乳源| 舟山市| 苗栗县| 日土县|