Skip to content

1、配置文件地址

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

2、bin目录

/opt/homebrew/Cellar/nginx/1.23.1/bin

3、前端页面地址

/opt/homebrew/var/www

4、启动nginx

shell
sudo nginx

5、关闭nginx

shell
sudo nginx -s stop

6、解决跨域

    server {
        listen       8080;
        server_name  192.168.0.114; #前端主机地址,我前后端都部署在局域网同一电脑上

        location / {
            root   html/dist;
            index  index.html index.htm;
            proxy_pass 192.168.0.114; #后端主机地址
        }