部署了三套程序,默认的,admin和design

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
    #tcp_nopush     on;

#keepalive_timeout  0;
    keepalive_timeout  65;

#gzip  on;

server {
        listen       80;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;
        
        location /api {
            proxy_pass http://localhost:8769;
        }

location / {
            root   html;
            #index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

# deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

server {
        listen       8888;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;
        
        root /opt/nginx/html/design;

location /design {
            try_files $uri $uri/ @router;
            index index.html index.htm;
        }

location @router {
          rewrite ^.*$ /index.html last;
        }

}

#不同的VUE要单独建立server
        server {
        listen       6666;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;
        
        root /opt/nginx/html/admin;
#VUE要访问的时候,把对应端口地址给映射出来
location /api {
            proxy_pass http://localhost:8769;
        }

location /admin {
            try_files $uri $uri/ @router;
            index index.html index.htm;
        }

location @router {
          rewrite ^.*$ /index.html last;
        }

}
    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

# HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

#    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

vue打包后放在 nginx部署时候的配置文件相关推荐

  1. vue打包后css路径_Vue打包后访问静态资源路径问题

    Vue打包后访问静态资源路径问题 Vue介绍中static文件夹里放的是静态资源目录,如图片.字体等. 我们发现运行npm run start后本地图片路径是没问题的,但是打包上传后会怎么样呢? 我们 ...

  2. [vue] 怎么解决vue打包后静态资源图片失效的问题?

    [vue] 怎么解决vue打包后静态资源图片失效的问题? 上面蛮多回答感觉像开玩笑似的,静态资源图片失效分几种情况. 1.确定线上环境是否在根路径上,配置资源根目录,vue-cli2 和 vue-cl ...

  3. flask 渲染 vue 打包后的dist文件(直接用后端渲染)

    flask 渲染 vue 打包后的dist文件(直接用后端渲染) vue项目打包出dist文件 npm run build 代码 from flask import Flask from flask ...

  4. vue 打包后访问接口报错404 解决方案 (前提是在vue里使用了代理)

    vue 打包后访问接口报错404 解决方案 (前提是在vue里使用了代理) 参考文章: (1)vue 打包后访问接口报错404 解决方案 (前提是在vue里使用了代理) (2)https://www. ...

  5. vue打包后element-ui部分样式(图标)异常问题

    vue打包后element-ui部分样式(图标)异常问题 参考文章: (1)vue打包后element-ui部分样式(图标)异常问题 (2)https://www.cnblogs.com/ljwsyt ...

  6. [vue] 怎么修改vue打包后生成文件路径?

    [vue] 怎么修改vue打包后生成文件路径? webpack:output.path vue-cli3: outputDir 个人简介 我是歌谣,欢迎和大家一起交流前后端知识.放弃很容易, 但坚持一 ...

  7. vue打包后出现一些map文件的解决方法

    Vue打包后出现一些map文件的解决办法: 问题: 可能很多人在做vue项目打包,打包之后js中,会自动生成一些map文件,那我们怎么把它去掉不要呢? 1.运行  cnpm run build  开始 ...

  8. vue上线后图片不显示_解决Vue打包后访问图片/图标不显示的问题

    大家可否遇到过 npm run build打包后,项目在线上运行时,资源文件 (图片.图标)不显示 的问题, 接下来,我给大家分享一下我的解决方案~ 1.检查打包后dist中的css文件 打开此文件后 ...

  9. vue 打包后,后缀名为.woff等字体问题不能用解决办法

    vue 打包后,后缀名为.woff等字体问题不能用解决办法 参考文章: (1)vue 打包后,后缀名为.woff等字体问题不能用解决办法 (2)https://www.cnblogs.com/mogu ...

最新文章

  1. OpenCV畸变校正原理以及损失有效像素原理分析
  2. ddos流量攻击有多少G_锐速云高防IP 专业防御大流量DDoS攻击
  3. vba java 网页_通过VBA提交JSP网站的Java脚本表单
  4. cas-client 使用(6)
  5. C++输入输出流加速器,关闭同步流,ios::sync_with_stdio(false)和 cin.tie(0)
  6. Nginx之http配置
  7. EF – 4.CRUD与事务
  8. java inflater_Android下LayoutInflater的正确使用姿势
  9. 市民云注销账号实名认证还有吗_这可能是全网最详细的注销网易服务的教程了...
  10. android设计字体规范,设计必备:字体使用规范
  11. vim命令失效了怎么办
  12. Android MediaProjection截屏与录屏(ScreenCapture Library 的使用)(二)
  13. Mac下Android 反编译
  14. 51cto 检测ip地址冲突_IP地址冲突解决办法
  15. 弘辽科技:淘宝提升销量不评价有效果吗?不提升销量能做起来吗?
  16. 冒泡 c语言,C语言:冒泡排序
  17. RNA保护液、FastAb佐剂、核酸提取试剂盒丨为您的实验锦上添花
  18. 灰色关联以及灰色预测GM(1,n),GM(1,1)模型(Python实现)
  19. 利用动态二进制加密实现新型一句话木马之.NET篇(转)冰蝎
  20. 小白入门Python Web之web开发前的准备(持续更新~)

热门文章

  1. Qt新添加的类无法链接
  2. 160 - 50 DueList.5
  3. getdate函数_PHP getdate()函数与示例
  4. linux下mac风格菜单栏,ubuntu 8.04 安装mac风格菜单
  5. LeetCode(合集)两数之和总结 (1,167,1346)
  6. linux 常用命令04 查找和检索
  7. manjaro linux下载软件,manjaro linux
  8. UVALive - 8512——线段树维护线性基
  9. MSG_PEEK标志
  10. 【Leetcode | 48】226. 翻转二叉树