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;
        }
}
相关推荐
dessler10 分钟前
代理服务器-LVS的3种模式与调度算法
运维·服务器·网络·算法·nginx·tomcat·lvs
Lw老王要学习27 分钟前
Linux容器篇、第二章_01Ubuntu22 环境下 KubeSphere 容器平台高可用搭建全流程
linux·运维·服务器·k8s·kubesphere·容器化
張萠飛1 小时前
Linux下如何使用shell脚本导出elasticsearch中某一个index的数据为本地csv文件
linux·运维·elasticsearch
晓枫-迷麟3 小时前
【nano与Vim】常用命令
linux·编辑器·vim
LucienShui3 小时前
Webhook 配置备忘
linux·运维·webhook
超级土豆粉4 小时前
从0到1写一个适用于Node.js的User Agent生成库
linux·ubuntu·node.js
PH_modest4 小时前
【Linux跬步积累】—— 网络编程套接字(二)
linux·运维·网络
CIb0la4 小时前
Ubuntu 25.10 将默认使用 sudo-rs
linux·程序人生·生活
成工小白4 小时前
【Linux】文件操作
linux·运维·服务器
2501_911121234 小时前
Nginx+Tomcat 负载均衡群集
nginx·tomcat·负载均衡