nginx on Mac
install
brew search nginx
brew install nginx
brew info nginx
你可以獲得docroot, docroot是指web server文件的根目錄浮还,因操作系統(tǒng)、web server軟件的不同而不同,可以看到mac nginx默認(rèn)的docroot是 /usr/local/var/www,
而CentOS nginx默認(rèn)的docroot是/usr/share/nginx/html百姓,Ubuntu/CentOS Apache默認(rèn)的docroot是/var/www/html
Docroot is: /usr/local/var/www
nginx -V
nginx version: nginx/1.17.9
built by clang 11.0.0 (clang-1100.0.33.17)
built with OpenSSL 1.1.1d 10 Sep 2019
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/1.17.9 --sbin-path=/usr/local/Cellar/nginx/1.17.9/bin/nginx --with-cc-opt='-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include' --with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl@1.1/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-compat --with-debug --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-ipv6 --with-mail --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module
可以看到nginx的安裝目錄是:/usr/local/Cellar/nginx/1.17.9
配置文件目錄:/usr/local/etc/nginx/nginx.conf
訪問(wèn)日志目錄:/usr/local/var/log/nginx/access.log
日志目錄:/usr/local/var/log/nginx/error.log
start nginx and check
nginx
localhost:8080
restart nginx
nginx -s reload
Tabix on Mac
clone Tabix
cd /usr/local/var/www
git clone https://github.com/smi2/tabix.ui
add configuration
tabix.conf
server {
listen 80;
server_name ui.tabix.io;
charset utf-8;
root /usr/local/var/www/tabix.ui/build;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if (!-f $request_filename) {
rewrite ^(.*)$ /index.html last;
}
index index.html index.htm;
}
}
cp tabix.conf /usr/local/etc/nginx/servers
restart nginx
nginx -s reload
login
說(shuō)明
Name: 任意
http://host:port: http://host:8123
Login: default
Password: empty
注意:Login和Password是你使用ClickHouse客戶端登錄時(shí)的用戶名和密碼