Mac安装nginx 流程配置
2021/7/2 7:23:12
本文主要是介绍Mac安装nginx 流程配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
http://nginx.org/en/download.html ``` mac安装 nginx Mac:brew install nginx ``` 出错提示。参考一下链接 #### mac环境下brew command not found错误的解决方法 http://www.chenxm.cc/article/1071.html nginx 配置文件: Mac: /usr/local/etc/nginx/nginx.conf ``` 测试配置文件格式是否正确 :nginx-t 启动: nginx 重启:nginx -s reload ``` 下载完成后。 第一步:进入控制台,sudo vi /usr/local/etc/nginx/nginx.conf 进入修改 3出地方 1.修改核心
#user nobody;
worker_processes 2;
#多核心的话就写2或者几几核
2.修改监听 端口号
server {
listen 8080;
server_name localhost;
#.....
}
3.屏蔽原有location 新增代理地址 #location / { # root html; # index index.html index.htm; # } location / { proxy_pass http://localhost:8001; } location /api/ { proxy_pass http://localhost:8000; proxy_set_header Host $host; }
这篇关于Mac安装nginx 流程配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-17Nginx实用篇:实现负载均衡、限流与动静分离
- 2024-08-21宝塔nginx新增8022端口方法步骤-icode9专业技术文章分享
- 2024-08-21nginx配置,让ws升级为wss访问的方法步骤-icode9专业技术文章分享
- 2024-08-15nginx ws代理配置方法步骤-icode9专业技术文章分享
- 2024-08-14nginx 让访问带有/relid的地址返回404 ,例子 /relid-x-0.36-y-131.html-icode9专业技术文章分享
- 2024-08-14nginx 判断地址有/statics/的路径,指向到/home/html/statics/目录-icode9专业技术文章分享
- 2024-07-24解锁Nginx日志的宝藏:GoAccess——你的实时、交互式Web日志分析神器!
- 2024-03-29fail2ban nginx
- 2024-03-18install nginx proxy manager
- 2024-01-2444从零开始用Rust编写nginx,命令行参数的设计与解析及说明