這篇文章將為大家詳細(xì)講解有關(guān)使用openstack怎么對(duì)80和443端口進(jìn)行共享,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

1.1. 安裝 openresty
1. 向 centos 系統(tǒng)中添加 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. 進(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或者所需端口。
關(guān)于使用openstack怎么對(duì)80和443端口進(jìn)行共享就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
分享標(biāo)題:使用openstack怎么對(duì)80和443端口進(jìn)行共享-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://chinadenli.net/article26/diidcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、軟件開發(fā)、電子商務(wù)、網(wǎng)站建設(shè)、做網(wǎng)站、定制開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容