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;
        }
}
相关推荐
En^_^Joy12 分钟前
Nginx 从入门到精通:配置、原理与实战详解
运维·nginx
玖石书29 分钟前
WSL2 手动安装 Ubuntu 24.04 到指定磁盘位置
linux·运维·ubuntu·wsl
库玛西1 小时前
深入浅出传输层:UDP 与 TCP 协议全景指南
linux·服务器·网络·c++·笔记·tcp/ip·udp
薛定谔的悦5 小时前
储能 EMS 的功率策略:从一块电表到一次逆流的 200 毫秒
大数据·linux·能源·储能·bms
新时代牛马8 小时前
Linux 内核入门地图:架构、源码目录与五大子系统
linux·运维·架构
Julien20048 小时前
控制 SELinux 文件上下文
linux·运维·服务器
sulikey9 小时前
Linux Core Dump 完全指南:从原理到实战的崩溃调试手册。什么是core dump?程序报错core dumped怎么办?
linux·服务器·操作系统·调试·coredump
2601_9621282611 小时前
Nginx目录结构
运维·nginx
MayZork11 小时前
Windows 与 Linux 下 vcpkg 的安装部署指南
linux·运维·windows
zbyyd12 小时前
Linux 进程间通信学习笔记
linux·笔记·学习