[精讚] [會員登入]
1847

apache 反向代理 80轉443轉8080

apache, proxy pass

分享此文連結 //n.sfs.tw/12281

分享連結 apache 反向代理 80轉443轉8080@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-10-25 11:48:08 最後編修
2018-03-21 14:47:08 By igogo
 

apache 服務 80 轉443 再轉 8080

 

以centos 7 為平臺

 

/etc/httpd/conf.d/ssoid.conf

#Listen 443 https
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS

<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName ssoid.tc.edu.tw
    <Directory "/var/www/html">
        Options -Indexes
        AllowOverride All
        Require all granted
    </Directory>
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteEngine on
RewriteCond %{SERVER_NAME} =ssoid.tc.edu.tw
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

 

所有輸入ssoid.tc.edu.tw 者  皆轉向 https

 

/etc/httpd/conf.d/ssl.conf

<VirtualHost _default_:443>

略...

 <Location />
     ProxyPass "http://127.0.0.1:8080/"
     ProxyPassReverse "http://127.0.0.1:8080/"
     Order deny,allow
     Allow from all
  </Location>


 <Location /app2>
     ProxyPass "http://127.0.0.1:8081/"
     ProxyPassReverse "http://127.0.0.1:8081/"
     Order deny,allow
     Allow from all
  </Location>

</VirtualHost>

 

https://xxx/app2 ;; 轉到內部的8081服務

 

END

你可能感興趣的文章

臺中市校務雲端系統與Windows AD帳號整合(1) active directory,ldaps,雲端校務系統

臺中市雲端校務系統與Windows AD帳號整合(8) 三 開機啟動服務 3-1 Windows Server上隨系統開機啟動服務 寫一個bat檔 cd C:UsersAdmi

[shell script] 批次判斷domain name 正解設定 判斷dns 正解設定

利用openssl 一行文產生私鑰及憑證請求檔 openssl 一行產生私鑰及憑證請求檔

如何檢查網站憑證是否過期 檢查網站憑證

mongo備份指令 mongodump --host localhost --port 27017 --username root --db

隨機好文

利用openssl 一行文產生私鑰及憑證請求檔 openssl 一行產生私鑰及憑證請求檔

利用expect script 查詢ap數量,再送到google sheet及line群組通知 利用expect script 查詢ap數量

學習帳號不在籍處理 雲端校務系統中學生異動可能是因轉學造成短期空檔不在籍 所以在判斷停用後, 時間註記在 syncAccount.getDa

使用指令設定windows 系統每日關機 schtasks /create /tn "Daily Shutdown" /tr "sh