{%hackmd DfWYF9cYREebVNN1eEOz-w %} web server ====== > ***不知自己不知道, 那你會以為你知道.*** ###### tags: `web server` `webServer` `202208` # Web Server ------ ref: - [[基礎觀念系列]Web Server & Nginx (1)](https://medium.com/starbugs/web-server-nginx-1-cf5188459108) - [[基礎觀念系列]Web Server & Nginx (2)](https://medium.com/starbugs/web-server-nginx-2-bc41c6268646) ------ ## Web Server .VS. Application Server 後者是指我們寫的應用程式,且具有跟 Web Server 溝通能力。 - Web Server: 只能處理靜態資源(ex: index.html),附載平衡 ...等。以及將請求丟給對應的 AP Server 去執行,最後把 response 丟回去。 - Web Server 處理靜態資源的能力很強。(或許可以來測試一下) ## 代理 Proxy - 反向代理: 透過負載平衡(LB Server),將請求分送到不同的 AP 上。 - client 只知道附載平衡的 Server,不用去知道實際做處理的 AP。 - 正向代理: Client 透過 Proxy 代表請求的發請人,Proxy Server 去跟指定 AP 通訊再將結果返回。 - server 只知道 Proxy server,但不知道實際發出請求的 client 是誰。 #### 一句話總結兩種代理 Proxy **反向代理隱藏真實的 Server,正向代理隱藏真實的 Client。** ## Nginx ### 特性 擅場處理 LB、Proxy、資源耗用比 Apach 低、靜態檔案處理遠優於 Apach、為現在主流開源網站服務器。 ### infra of Linux - 所有的設定都來自於 config file,Nginx 主設定檔會放在 ```/etc/nginx/nginx.conf``` - 不同的域名對應的 config file 會放在 ```/etc/nginx/conf.d/<<dommain>>.conf``` - 如果要啟動/引入自定義的 config,則在主設定檔中的 http context 加入 ```include /etc/nginx/conf.d/*.conf;```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up