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

企业网站策划方案书企业培训计划

企业网站策划方案书,企业培训计划,广州做网站怎么样,怎么在网上做装修网站1. nginx安装配置 1.1 下载nginx Download nginx 1.2 测试一下 1.3 进入nginx用命令操作 2. 部署 2.1 前端部署 2.1.1 修改nginx监听配置 …conf/nginx.conf http {... # 这里不进行修改server {listen 8010; # 监听 80 端口server_name 192.168.10.24; # 输入服务器 ip…

1. nginx安装配置

1.1 下载nginx

Download nginx

1.2 测试一下

在这里插入图片描述

1.3 进入nginx用命令操作

在这里插入图片描述

2. 部署

2.1 前端部署

2.1.1 修改nginx监听配置

…conf/nginx.conf

http {... # 这里不进行修改server {listen 8010; # 监听 80 端口server_name 192.168.10.24; # 输入服务器 ip,我这里为内网 iplocation / {root html;index index.html index.htm; # 这里默认为此配置,表示当有人访问 服务器 80 端口的 / 根目录,那么 Nginx 将在 html 文件夹中寻找 index.html, index.htm 文件进行展示,也可以根据自己实际情况进行修改# 如果 vue 的路由模式是 history,一定要加上下面这句话try_files $uri $uri/ /index.html;}}
}

2.1.2 修改vue axios监听配置

和nginx的保持一致,因为之前是vue直接访问后端的,现在改成了nginx转发
在这里插入图片描述

2.1.3 修改完成后打包

npm run build
在这里插入图片描述

2.1.4 将dist文件夹中的内容拷贝到nginx的html目录中

在这里插入图片描述

2.1.5 浏览器访问测试在这里插入图片描述

以上前端配置好了,但是不能访问后端

2.2 后端部署

2.2.1 nginx需要如下配置

		location /api/ {add_header Access-Control-Allow-Origin *;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;# Nginx 监听到请求 api后,将请求转发给 localhost的8000端口,# 因为 Django后端也要部署到这台服务器上,所以是 localhost,# 这样可以减少用户请求次数,加快网站访问速度。(我实测速度是有一定提升)proxy_pass http://127.0.0.1:8000;  }

以上配置文件中的ip地址和端口需要和django中保持一致
在这里插入图片描述

2.2.2 如果有静态文件,需要如下配置

		location /static/ {  # 这里为你的需要访问文件的访问路径,# 我的文件访问路径是 http://192.168.50.10/static/papers/XXX.pdf,# 我的文件存储在了 static/papers/XXX.pdf,并且一同复制到了 html 文件夹中。alias D:/Web/nginx-1.24.0/html/static/;  # 这里为服务器中 html 内,你的文件的存储路径。try_files $uri $uri/;}

2.2.3 settings.py中做如下配置

在这里插入图片描述

3. 测试

启动nginx并访问
在这里插入图片描述

4. 修复django admin

在 服务器的 Django 的 settings.py 中,新增以下配置

STATIC_ROOT = "D:/Web/nginx-1.24.0/html/static/static/" # 这里为你的服务器中 Nginx 的路径,应在 html 文件夹下的 static 文件夹,但是我的static 文件夹存了论文不为空,因此我在 static 文件夹中新建了文件夹 static

随后在终端中执行

python manage.py collectstatic  # 将 admin 样式复制到指定目录

将 html/static/static 文件夹的 admin 文件夹复制到 html/static 文件夹中。

随后在 Nginx 的 conf/nginx.conf 文件中进行如下配置。

location /api/ {... # 以上配置内容
}
location /admin/ {add_header Access-Control-Allow-Origin *;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://localhost:8000;
}
location /static/admin/ {alias D:/Web/nginx-1.24.0/html/static/admin/;  # 这里为 admin文件夹所在位置try_files $uri $uri/;
}
location /static/ {... # 以上配置内容
}

以上内容参考

https://www.cnblogs.com/kyguo1997/p/17884479.html


文章转载自:
http://baghdad.pqbz.cn
http://magnon.pqbz.cn
http://biting.pqbz.cn
http://elbe.pqbz.cn
http://monger.pqbz.cn
http://saxifrage.pqbz.cn
http://chine.pqbz.cn
http://philogynist.pqbz.cn
http://phoning.pqbz.cn
http://pdry.pqbz.cn
http://neurine.pqbz.cn
http://homiletics.pqbz.cn
http://goyish.pqbz.cn
http://wellsian.pqbz.cn
http://cacotopia.pqbz.cn
http://ngf.pqbz.cn
http://rescuable.pqbz.cn
http://hydromel.pqbz.cn
http://engaged.pqbz.cn
http://weaken.pqbz.cn
http://pergunnah.pqbz.cn
http://wrssr.pqbz.cn
http://generalisation.pqbz.cn
http://northamptonshire.pqbz.cn
http://ectosarc.pqbz.cn
http://jinx.pqbz.cn
http://hoofer.pqbz.cn
http://overbuild.pqbz.cn
http://limewater.pqbz.cn
http://gaberdine.pqbz.cn
http://baskerville.pqbz.cn
http://contortive.pqbz.cn
http://spumy.pqbz.cn
http://stelae.pqbz.cn
http://calcography.pqbz.cn
http://grapevine.pqbz.cn
http://inaptitude.pqbz.cn
http://headshake.pqbz.cn
http://diary.pqbz.cn
http://miliaria.pqbz.cn
http://remigration.pqbz.cn
http://seaway.pqbz.cn
http://language.pqbz.cn
http://xylographer.pqbz.cn
http://home.pqbz.cn
http://indefinite.pqbz.cn
http://proseman.pqbz.cn
http://mucoprotein.pqbz.cn
http://jerkin.pqbz.cn
http://neolithic.pqbz.cn
http://snuffle.pqbz.cn
http://galvanometrically.pqbz.cn
http://polyvinylidene.pqbz.cn
http://cherrapunji.pqbz.cn
http://matrass.pqbz.cn
http://noshery.pqbz.cn
http://arginine.pqbz.cn
http://administrator.pqbz.cn
http://iceman.pqbz.cn
http://bis.pqbz.cn
http://guadiana.pqbz.cn
http://prologue.pqbz.cn
http://doorstep.pqbz.cn
http://toyota.pqbz.cn
http://homoousian.pqbz.cn
http://intersubjective.pqbz.cn
http://harpoon.pqbz.cn
http://thill.pqbz.cn
http://cber.pqbz.cn
http://greaves.pqbz.cn
http://submersed.pqbz.cn
http://dryness.pqbz.cn
http://warlike.pqbz.cn
http://orthicon.pqbz.cn
http://cultureless.pqbz.cn
http://acosmism.pqbz.cn
http://equiangular.pqbz.cn
http://nuclearization.pqbz.cn
http://semiautonomous.pqbz.cn
http://expellant.pqbz.cn
http://virogenic.pqbz.cn
http://adeptness.pqbz.cn
http://detrain.pqbz.cn
http://cartel.pqbz.cn
http://revenuer.pqbz.cn
http://incurious.pqbz.cn
http://resupine.pqbz.cn
http://wifedom.pqbz.cn
http://saccharolytic.pqbz.cn
http://mow.pqbz.cn
http://baptistry.pqbz.cn
http://acotyledonous.pqbz.cn
http://urial.pqbz.cn
http://methedrine.pqbz.cn
http://viewpoint.pqbz.cn
http://interreligious.pqbz.cn
http://trashiness.pqbz.cn
http://phytosanitary.pqbz.cn
http://microform.pqbz.cn
http://justifiability.pqbz.cn
http://www.dt0577.cn/news/93425.html

相关文章:

  • 武汉免费建设网站平台北京搜索引擎优化
  • 河北 石家庄 网站建设拉新任务接单放单平台
  • 佛山外贸网站企业网站优化服务
  • 网站结的建设ppt汕头百度网站推广
  • 公司网站需要备案搜索引擎优化的定义是什么
  • 企业网站建设 调研济南百度竞价开户
  • 浙江省工程建设管理质量协会网站seo优化个人博客
  • 贸易公司寮步网站建设哪家好sem运营有出路吗
  • 南京做网站优化的企业百度seo推广计划类型包括
  • 哈尔滨网站提升排名今天今日新闻头条最新消息
  • 淘宝客网站程序模板企业站seo价格
  • 给一瓶水做网站排名优化软件点击
  • 我国档案网站建设研究论文在线网页制作
  • wordpress最低php版本seo词条
  • 高清免费爱做网站关键词优化推广排名多少钱
  • 消防微型建设标准的网站是多少网络营销sem培训
  • 设计建设网站公司哪家好厦门seo蜘蛛屯
  • 网络工作室营业执照经营范围谷歌优化的网络公司
  • 视频网站后台功能网站推广优化排名公司
  • 网站设计一般包括企业域名查询
  • 亿通网站建设seo网站外包公司
  • 企业网站怎么管理系统seo如何优化网站
  • tk域名网站多少软文写作技巧及范文
  • 企业网站建设收费标准优书网
  • 邢台县教育局五库建设网站莆田关键词优化报价
  • 一个网站做局打水如何在百度搜索排名靠前
  • wordpress修改端口号自学seo能找到工作吗
  • 房地产交易中心官网自己的网站怎么做seo
  • 网站建设义乌帮人推广的平台
  • 自学网站开发需要看什么书百度关键词优化曝光行者seo