Scott

nginx安装 2 years ago

nginx
windows
561个字符
共有139人围观

windows安装nginx

windows安装nginx很简单

1, 到 官网 下载对应的版本:x86表示32位 64表示64位

2,解压到任意盘符,以 D:\nginx-1.20.2为例:

3,将路径加入到系统环境变量%PATH%中,这样不管你在任何目录打开终端输入nginx都可以启动nginx

linux安装nginx

#ubuntu
sudo apt install nginx

root dir: /etc/var/www

默认配置文件位置:/etc/nginx/nginx.conf, 查看主配置文件可知:默认会加载conf.d下所有的配置文件

Macos安装nginx

brew install nginx
# 查看nginx配置文件位置
brew info nginx

Docroot is: /opt/homebrew/var/www 默认配置文件:/opt/homebrew/etc/nginx/nginx.conf , 默认端口: 8080 , 查看主配置文件可知:默认会加载conf.d下所有的配置文件