当前位置: 首页 > news >正文

网站改版 建设方案哪些品牌网站做的好

网站改版 建设方案,哪些品牌网站做的好,wordpress改后台,seo指哪些市场区域1. 打包 在项目包的终端使用命令打包成dist文件。 npm run build2. Linux云服务器上创建文件夹 mkdir /home/www/dist注:dist文件夹不用创建,将打包好的dist.zip放进去,然后解压就行。 3. 安装nginx yum install -y nginx4. 修改配置文件…

1. 打包

在项目包的终端使用命令打包成dist文件。

npm run build

2. Linux云服务器上创建文件夹

mkdir /home/www/dist

注:dist文件夹不用创建,将打包好的dist.zip放进去,然后解压就行。

3. 安装nginx

yum install -y nginx

4. 修改配置文件

vim /etc/nginx/nginx.conf

配置文件原样:

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;events {worker_connections 1024;
}
http {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  /var/log/nginx/access.log  main;sendfile            on;tcp_nopush          on;tcp_nodelay         on;keepalive_timeout   65;types_hash_max_size 4096;include             /etc/nginx/mime.types;default_type        application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;server {listen       80;listen       [::]:80;server_name  _;root         /usr/share/nginx/html;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location = /404.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2;
#        listen       [::]:443 ssl http2;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }}

我们可以看到其中一行

 include /etc/nginx/conf.d/*.conf;

说明他包含同级conf.d目录下的*.conf文件;所以根据个人喜好,我进入conf.d目录,创建xxx.conf文件,配置如下:

    server {listen       9999;server_name  _;root         /home/vue/dist;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location = /404.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}location /{root /home/vue/dist;index index.html;try_files $uri $uri/ /index.html;} }    

被一个点卡了很久:!!!这个是用来解决刷新路由404问题,写全,可能因为版本问题,不写全导致一直说配置格式错误啥的…可累死我了!!!

        location / {root /home/vue/dist;index index.html;try_files $uri $uri/ /index.html;}  

5. 启动 / 重启 nginx

启动:

nginx

重启:

nginx -s reload

6. 访问前端项目

使用服务器 IP + 端口 访问前端项目。
注:端口需要在服务器防火墙开启对外开放。

http://www.yayakq.cn/news/678230/

相关文章:

  • 做的好看的pc端网站中山哪里网站建设
  • 自己电脑上做网站深圳海洋网络做网站
  • 网站建设创业计划书范文大全千万别学交互设计
  • 如何用虚拟主机建设网站企业cms免费模板
  • 佛山专业网站建设哪家好中国城乡建设部官网
  • 山东住房建设厅官网站首页品质好物推荐怎么上
  • 网站后台地址忘记了重庆市有几个区
  • 建设网站的公司wordpress不兼容ie
  • 青岛李沧网站建设传奇网站传奇
  • 哪个网站做废旧好福建建设资格执业注册管理中心网站
  • 批量建站怎么赚钱适合美工的网站
  • 精品课程网站设计创办公司需要多少资金
  • 网页设计师都在什么网站上面找素材在线crm网站
  • 网站开发建设流程网站开发人才培养目标
  • 网站制作公司 云南瑞安网
  • 书店网站模板东阿做网站推广
  • 分子信标探针在线设计网站怎样申请一个免费网站
  • wordpress多站点模式江阴服装外贸现状
  • 重庆网站建设 重庆网站制作2018一级a做爰片免费网站
  • 电商网站开发视频模板免费制作
  • 温州外贸网站设计宣传册设计与制作软件
  • 免费建网站那个好怎么用自助网站
  • jsp网站建设项目实战网站降权分析
  • 曲周企业做网站推广wordpress英文企业主题下载
  • 中卫网站网站建设wordpress 主题 下载
  • 信息发布网站开发中企动力是干什么的
  • 青岛网站建设青岛博采网络建设部网站网站建设
  • 网站开发商城实例平面设计接单网站有哪些
  • 免费织梦网站模板电子商务的网站案例
  • 网页设计作品到哪个网站秦皇岛吧 百度贴吧