nginx

2020-06-02  本文已影响0人  jane819
server {
        listen       80;//http 端口80;https 端口 443
        server_name  aa.com; //服务器域名

        root /Users/steven/Documents/jane/project/dist; //项目打包之后生成的根目录查看根目录路径:pwd 

        location / {
            try_files $uri $uri/ @router;
            index  index.html index.htm;
        }
        location /napi/ {
            proxy_http_version 1.1;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:1235/;
        }
        location @router {
            rewrite ^.*$  /index.html last;
        }
  }
上一篇下一篇

猜你喜欢

热点阅读