First, install Nginx
- Terminal execution:
Brew Search Nginxbrew Install Nginx
The current version of 1.10.2, through the brew can be pcre,openssl,zlib all you need to install a key.
After installation, you can see some configuration paths in the terminal output information:
/usr/local/etc/nginx/nginx.conf (configuration file path)/usr/local/var/www (server default path)/usr/local/cellar/nginx/1.10.2_1 (Installation path)
Execution Nginx-v can see some of the installation configuration process options, can be automated installation, do not install manually, or there will be a variety of unexpected problems.
Nginx version:nginx/1.10.2built by Clang8.0.0(clang-800.0. -) built with OpenSSL1.1.0b -Sep .TLS SNI Support enabledconfigure arguments:--prefix=/usr/local/cellar/nginx/1.10.2_1--with-http_ssl_module--with-pcre--sbin-path=/usr/local/cellar/nginx/1.10.2_1/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-http_gzip_static_module--with-ipv6
Can be performed by Ps-ef | grep nginx Quick View of the Nginx master process PID, kill to close, by executing nginx-c/user/local/etc/nginx/nginx.conf to reopen
Ii. Visit localhost:8080
Nginx default port 8080, you can already access:
localhost:8080
There will be a default welcome interface.
Mac installation under Nginx