1、配置文件地址

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

2、bin目录

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

3、前端页面地址

1
/opt/homebrew/var/www

4、启动nginx

1
sudo nginx

5、关闭nginx

1
sudo nginx -s stop

6、解决跨域

1
2
3
4
5
6
7
8
9
server {
listen 8080;
server_name 192.168.0.114; #前端主机地址,我前后端都部署在局域网同一电脑上

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