目录

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

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

brew install nginx
brew info nginx

https://i-blog.csdnimg.cn/direct/e8702aaef258448eb0a14d446951fdc9.png

/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;
        }
}