>[danger]mac上安裝Ngnix
1. 查看ngnix的一些默認配置
`$ brew info nginx`

2. 正式安裝
`$ brew install nginx `
3. nginx 真正安裝到的位置
`$ /usr/local/Cellar/nginx`
4. 資源文件路徑
`$ /usr/local/var/www`
5. 啟動nginx服務
`$ nginx`
沒有任何反應是正常的
6. 訪問localhost:8080, 成功了

>[danger]Nginx配置
----
查看文件 `$ /usr/local/etc/nginx/nginx.conf`
```
# 運行用戶, 默認即是nginx, 可不設置
#user nobody;
# 一般設置和CPU內核數一樣
worker_processes 1;
# 錯誤日志存放目錄
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
# 進程pid存放的位置
#pid logs/nginx.pid;
# 工作模式以及連接上限
events {
# 單個后臺worker process進程最大并發連接數
worker_connections 1024;
}
http {
# 文件擴展名與類型映射表
include mime.types;
# 默認文件類型
default_type application/octet-stream;
# 設置日志模式 (日志格式)
# $remote_addr 與 $http_x_forwarded_for 用以記錄客戶端的ip地址;
# $remote_user :用來記錄客戶端用戶名稱
# $time_local : 用來記錄訪問時間與時區;
# $request : 用來記錄請求的url與http協議;
# $status : 用來記錄請求狀態;成功是200;
# $body_bytes_s ent :記錄發送給客戶端文件主體內容大小;
# $http_referer :用來記錄從那個頁面鏈接訪問過來的;
# $http_user_agent :記錄客戶端瀏覽器的相關信息;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
# nginx訪問日志(并使用main 日志格式)
#access_log logs/access.log main;
# 開啟高效傳輸模式
sendfile on;
# 激活tcp_nopush參數可以允許把httpresponse header和文件的開始放在一個文件里發布,
# 積極的作用是減少網絡報文段的數量
#tcp_nopush on;
# 連接超時時間,單位是秒
#keepalive_timeout 0;
keepalive_timeout 65;
# 開啟gzip壓縮功能
#gzip on;
# 基于域名的虛擬主機
server {
# 監聽端口 8080
listen 8080;
# 服務器名字 (客戶端訪問localhost:8080即可)
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# 請求的url過濾, /代表請求根路徑. ~區分大小寫, ~*不區分大小寫
location / {
# 設置根目錄
root html;
# 設置默認頁
index index.html index.htm;
# proxy_pass http://mysvr; # 請求轉向mysvr 定義的服務器列表
# deny xx.xx.xx.xx; # 拒絕的ip
# allow xx.xx.xx.xx; # 允許的ip
}
# 錯誤頁面 404
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
# 50開頭狀態 對應頁面
error_page 500 502 503 504 /50x.html;
# 訪問50.html頁面
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# 匹配符合php擴展名的請求
#location ~ \.php$ {
# root html;
# #拋給本機的9000端口
# fastcgi_pass 127.0.0.1:9000;
# 設定動態頁
# fastcgi_index index.php;
# 腳本文件請求的路徑
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# 文件擴展名與類型映射表
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# 另外一個服務器配置表
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# 服務端證書和服務端key所在路徑
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
include servers/*;
}
```
- web前端
- CSS問題
- 布局
- 雙飛翼布局_flex方式
- 雙飛翼布局_margin方式
- 圣杯布局_flex方式
- 圣杯布局_margin方式
- 子元素居中問題
- 彈性布局
- 概念_
- 標準模式與混雜模式
- 各種FC
- line-height
- vertical-align
- CSS3新特性
- 效果
- div添加箭頭
- CSS繪制三角形
- JavaScript
- 兼容
- 事件相關
- 原理
- Ajax原理
- 繼承原理
- 原型鏈繼承
- 組合繼承
- 寄生組合繼承
- 數據綁定
- 1單向數據綁定m到c到v
- 2偽雙向數據綁定
- 3雙向數據綁定
- socket.io
- 運行時
- this指向
- 0.1+0.2問題
- 對象/數組-深拷貝&淺拷貝
- 事件循環
- typeof
- instanceof
- 概念
- 閉包
- 回調函數
- Promise
- 原生對象
- Attribute和property區別
- 防抖函數
- 節流函數
- 語言類型
- Vue
- Vue優缺點
- 仿Vue源碼
- 1數據綁定_Observe
- 2數據綁定_訂閱者&觀察者定義
- 3數據綁定_Vue類實現
- 4數據綁定_Vue訪問data更改
- 5DOM編譯_Compile_雙大括號模板講解
- 6DOM編譯_v-model講解
- 7DOM編譯_v-on:事件綁定講解
- 項目總結
- 使用Svg圖標
- vueCli環境_真機測試
- vueCli集成環信SDK
- 父子組件雙向綁定
- React
- React優缺點
- 我的組件庫
- Vue的組件庫
- 環信_聊天組件
- 面試題
- HTML_分類
- CSS_分類
- JavaScript_分類
- VueJS_分類
- ReactJS_分類
- AngularJS_分類
- 瀏覽器端
- 筆試題
- CSS
- 特殊布局
- JavaScript_
- 經典_宏任務_微任務
- 瀏覽器問題
- CORS
- web服務器
- Apache
- 開啟跨域
- Nginx
- 常用命令
- 正向代理
- 反向代理
- 負載均衡
- mac安裝Nginx
- 配置80端口
- 算法
- 冒泡排序
- 選擇排序
- 合并對象_排序
- 楊輝三角
- 紅黑樹
- 計算機基礎
- 網絡相關
- OSI七層模型
- http協議
- http工作原理
- https協議
- GET和POST區別
- hosts文件
- php相關
- session機制
- Linux
- 阿里云服務器
- linux使用Mysql
- 安裝mysql
- 導入.sql文件
- 遠程連接mysql
- linux使用xampp
- 安裝Xampp
- 配置web訪問
- 域名綁定服務器
- linux搭建git服務器_apache下
- 代碼管理
- 什么是git
- 命令行_使用git
- .gitignore文件講解
- 軟件
- VSCode的安裝
- 理財
- 基金
- 攝影