差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:apache [2021/12/02 12:31] – [設定啟用 HSTS] jonathantech:apache [2025/10/17 10:59] (目前版本) – [- ProxyPass directive 抓遠端主機頁面] jonathan
行 1: 行 1:
 ====== Apache WebServer 設定技巧 ====== ====== Apache WebServer 設定技巧 ======
 ===== 設定啟用 HSTS ===== ===== 設定啟用 HSTS =====
 +  * [[https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security|點這裡了解 HSTS(HTTP Strict Transport Security)]]
   * 將 httpd.conf 內的 headers_module 啟用<file>   * 將 httpd.conf 內的 headers_module 啟用<file>
 : :
行 7: 行 8:
   * VirtualHost 內增加 header 設定<file>   * VirtualHost 內增加 header 設定<file>
 : :
 +<VirtualHost www.example.com:80>
 +Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
 +</VirtualHost>
 +
 <VirtualHost www.example.com:443> <VirtualHost www.example.com:443>
 Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
行 17: 行 22:
   * 編輯 virtual host exp. <cli>vi sites-enabled/wordpress.conf</cli><file>   * 編輯 virtual host exp. <cli>vi sites-enabled/wordpress.conf</cli><file>
 : :
 +<VirtualHost *:80>
 +    UseCanonicalName Off
 +    ServerAdmin  webmaster@localhost
 +    DocumentRoot /var/www/wordpress
 +    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
 +</VirtualHost>
 +
 <VirtualHost *:443> <VirtualHost *:443>
     SSLEngine on     SSLEngine on
行 85: 行 97:
 我是用在將 VMWare 在內部運作的網頁能夠簡易的呈現到 Internet 的 WebServer 上. 我是用在將 VMWare 在內部運作的網頁能夠簡易的呈現到 Internet 的 WebServer 上.
  
-<ditaa name=ProxyPass+<mermaid
- +graph LR 
-                +----------------------+   +--------------+ +    Browser["Browser"] 
-  +---------+   webServer(ProxyPass) |     vm-mail    | +    WebServer["webServer (ProxyPass)<br/>/webmail<br/>mail.ichiayi.com"] 
-  | Browser +-->+       /webmail       +-->+  /webmail    | +    VMmail["vm-mail<br/>/webmail<br/>192.168.11.238"] 
-  +---------+     mail.ichiayi.com   |   |192.168.11.238| +     
-                +----------------------+   +--------------+ +    Browser -->|"訪問"| WebServer 
- +    WebServer -->|"ProxyPass 轉發"| VMmail 
-</ditaa>+     
 +    style Browser fill:#e1f5ff,stroke:#333,stroke-width:2px 
 +    style WebServer fill:#fff4e1,stroke:#333,stroke-width:2px 
 +    style VMmail fill:#e1ffe1,stroke:#333,stroke-width:2px 
 +</mermaid>
  
 Browser 連上 webServer(http://mail.ichiayi.com/webmail), 出現的畫面是由 vm-mail(http://192.168.11.238/webmail) 所提供頁面 Browser 連上 webServer(http://mail.ichiayi.com/webmail), 出現的畫面是由 vm-mail(http://192.168.11.238/webmail) 所提供頁面
行 166: 行 182:
   * http://httpd.apache.org/docs/2.2/mod/core.html#satisfy   * http://httpd.apache.org/docs/2.2/mod/core.html#satisfy
   * https://docs.microfocus.com/SM/9.60/Hybrid/Content/security/concepts/support_of_http_strict_transport_security_protocol.htm   * https://docs.microfocus.com/SM/9.60/Hybrid/Content/security/concepts/support_of_http_strict_transport_security_protocol.htm
 +  * https://www.simplified.guide/apache/enable-hsts
  
 {{tag>apache httpd 密技}} {{tag>apache httpd 密技}}
  • tech/apache.1638419482.txt.gz
  • 上一次變更: 2021/12/02 12:31
  • jonathan