nginx配置vue项目

server {
        # 端口号
        listen       3309;
        # IP
        server_name  192.168.1.3;

        location / {
                # 执行目录
                root   /var/www/vue-app-base/dist/;
                index index.html;
                # index  index.html index.htm;
                # vue支持路由跳转
                try_files  $uri $uri/ /index.html;
        }

        # 反向代理 解决跨域问题
        location ^~ /riegl/ {
                proxy_pass http://192.168.1.3:8080;
        }

        location ^~ /APX/ {
                proxy_pass http://192.168.1.3:8080;
        }

        location ^~ /set/ {
                proxy_pass http://192.168.1.3:8080;
        }
}
原文地址:https://www.cnblogs.com/zhangxuechao/p/15137458.html