mac本地代理nginx,解决跨域问题

复制代码
brew install nginx

brew info nginx

nginx配置文件

/opt/homebrew/etc/nginx/nginx.conf

如何打开呢?

复制代码
open /opt/homebrew

启动nginx

复制代码
brew services start nginx

改配置:

复制代码
server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            #root   html;
            #index  index.html index.htm;
	 proxy_pass http://localhost:8082;
        }
}
相关推荐
Johny_Zhao7 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
闲云一鹤2 天前
nginx 快速入门教程 - 写给前端的你
前端·nginx·前端工程化
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号2 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash2 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
十日十行3 天前
Linux和window共享文件夹
linux