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

部署了三套程序,默认的,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;
    #    }
    #}


}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/387103.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

淘淘商城之技术选型、开发工具和环境、人员配置

一、技术选型 1)Spring、SpringMVC、Mybatis 2)JSP、JSTL、jQuery、jQuery plugin、EasyUI、KindEditor(富文本编辑器)、CSSDIV 3)Redis(缓存服务器) 4)Solr(搜索&#x…

启动代码格式:nginx安装目录地址 -c nginx配置文件地址

启动启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如:[rootLinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf停止nginx的停止有三种方式: 从容停止1、查看进程号[rootLinuxServer ~]# ps -ef…

Lecture 3 Divide and Conquer

1.Divide the problem(instance) into one or more sub-problem; 2.Conquer each sub-problem recursively; 3.Combine solutions.

Maven报错找不到jre

富人之所以越来越富,穷人之所以越来越穷,中产阶级之所以总是在债务泥潭中挣扎,其主要原因之一在于他们对金钱的观念不是来自学校,而是来自家庭。 ---《穷爸爸富爸爸》 一、报错提示 常规配置maven环境变量,报错&#x…

vue按照url地址访问出错404

问题描述: 最近在开发cms的时候使用Vue.js框架,利用vue-route结合webpack编写了一个单页路由项目,自己在服务器端配置nginx。部署完成后,访问没问题,从页面中点击跳转也没问题,但是只要点击刷新或通过浏览器…

Lecture 4 Quick Sort and Randomized Quick Sort

Quick Sort --Divide and Conquer --Sorts “in place” --Very practical with tuning Divide and Conquer: 1.Divide: Partition array into 2 sub-arrays around pivot x such that elements in lower sub-array < x < elements in upper sub-array; 2.Conquer: …

HDU 3966 树链剖分后线段树维护

题意: 一棵树, 操作1.$path(a,b)$之间的点权$k$ 操作2.单点查询 题解: 树链剖分即可,注意代码细节,双向映射 主要是记录一下板子 #include <string.h> #include <stdio.h> #include <algorithm> #define endl \n #define ll long long #define ull unsigned …

VUE config/index.js文件配置

&#xfeff;&#xfeff; 当我们需要和后台分离部署的时候&#xff0c;必须配置config/index.js: 用vue-cli 自动构建的目录里面 &#xff08;环境变量及其基本变量的配置&#xff09;123456789101112131415var path require(path)module.exports {build: {index: path.res…

数据规则列表加导入导出

1.进入bos&#xff0c;打开数据规则&#xff0c;进入列表菜单 2.点击事件-新增操作 3.点击新增 4.点击操作类型&#xff0c;输入%引入 5.点击确定&#xff0c;保存后生效&#xff0c;导出 、引入模板设置同理转载于:https://www.cnblogs.com/RogerLu/p/10643521.html

Lecture 6 Order Statistics

Given n elements in array, find kth smallest element (element of rank k) Worst-case linear time order statistics --by Blum, Floyd, Pratt, Rivest, Tarjan --idea: generate good pivot recursively. Not so hot, because the constant is pretty big.

C++ qsort() 函数调用时实参与形参不兼容的问题解决

《剑指OFFER》刷题笔记 —— 扑克牌顺子 LL今天心情特别好,因为他去买了一副扑克牌,发现里面居然有2个大王,2个小王(一副牌原本是54张^_^)...他随机从中抽出了5张牌,想测测自己的手气,看看能不能抽到顺子,如果抽到的话,他决定去买体育彩票,嘿嘿&#xff01;&#xff01;“红心A…

linux jenkins部署之路之,ftp部署怎么匿名还好用咋解决思密达

怎么安装就不说了&#xff0c;网上一堆 这噶搭是配置 目录是/etc/vsftpd/vsftpd.conf # Example config file /etc/vsftpd/vsftpd.conf# # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more u…

powerCat进行常规tcp端口转发

实战中&#xff0c;我们也会遇到需要我们进行端口转发的情况&#xff0c;比如已经拿下的目标机1是在dmz区&#xff0c;而目标1所在内网的其他目标只能通过目标1去访问&#xff0c;这时候我们就需要端口转发或者代理来进行后渗透。这次就要介绍一个加强版的nc&#xff0c;基于po…

Lecture 7 Hashing Table I

Hash |---Hash function: Division, Multiplication |---Collision: Chaining, Open addressing(Linear,Double hasing) Symbol-table problem: Table S holding n records pointer --> key|satelite data (record) Hashing: Hash function h maps keys “randomly”…

SpringCloud 微服务

一微服务架构概述1.1 微服务特性以及优点每个服务可以独立运行在自己的进程里一系列独立运行的微服务(goods,order,pay,user,search…)共同构建了整个系统每个服务为独立的业务开发&#xff0c;一个微服务只关注某个特定的功能&#xff0c;例如用户管理&#xff0c;商品管理微服…

window起别名

http://www.bagualu.net/wordpress/archives/1714 转载于:https://www.cnblogs.com/wei-huan/p/10654026.html

vue在ie9中的兼容问题

问题总结 https://github.com/vuejs-templates/webpack/issues/260 首先npm install --save babel-polyfill然后在main.js中的最前面引入babel-polyfillimport babel-polyfill在index.html 加入以下代码&#xff08;非必须&#xff09;<meta http-equiv"X-UA-Compatib…

Lecture 9 Random built Binary Search Trees BSTs

Random built Binary Search Trees BSTs E[hight] near 3logn Quick Sort? Relation to Quick Sort: BST sort & Quick sort make same comparisons but in a different order. Randomized BST Sort: 1. Randomly permute A 2. BST sort(A)

spring boot 带远程调试启动方式

比如启动service-system-0.0.1-SNAPSHOT.jar和service-file-0.0.1-SNAPSHOT.jar nohup java -Xdebug -Xrunjdwp:servery,transportdt_socket,address7999,suspendn -jar service-system-0.0.1-SNAPSHOT.jar > /dev/null 2>&1 &nohup java -Xdebug -Xrunjdwp:se…