使用nginx搭建Tabix on mac

nginx on Mac

install

brew search nginx
brew install nginx

brew info nginx

你可以获得docroot, docroot是指web server文件的根目录,因操作系统、web server软件的不同而不同,可以看到mac nginx默认的docroot是 /usr/local/var/www,
而CentOS nginx默认的docroot是/usr/share/nginx/html,Ubuntu/CentOS Apache默认的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/[email protected]/include' --with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/[email protected]/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
访问日志目录:/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

Screen Shot 2020-03-26 at 7.52.35 AM.png

说明

Name: 任意
http://host:port: http://host:8123
Login: default
Password: empty
注意:Login和Password是你使用ClickHouse客户端登录时的用户名和密码

你可能感兴趣的:(使用nginx搭建Tabix on mac)