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

苏州艺术家网站建设公司推广咨询

苏州艺术家网站建设,公司推广咨询,百度云 做视频网站,淘宝联盟怎么样做网站👨‍🎓博主简介 🏅CSDN博客专家   🏅云计算领域优质创作者   🏅华为云开发者社区专家博主   🏅阿里云开发者社区专家博主 💊交流社区:运维交流社区 欢迎大家的加入&#xff01…

👨‍🎓博主简介

  🏅CSDN博客专家
  🏅云计算领域优质创作者
  🏅华为云开发者社区专家博主
  🏅阿里云开发者社区专家博主
💊交流社区:运维交流社区 欢迎大家的加入!
🐋 希望大家多多支持,我们一起进步!😄
🎉如果文章对你有帮助的话,欢迎 点赞 👍🏻 评论 💬 收藏 ⭐️ 加关注+💗


文章目录

  • 一个域名带https配置多个项目
  • 一个域名配置多个项目
  • 本机地址配置多个项目
  • 相关文章
  • 相关专栏

在这里插入图片描述

一个域名带https配置多个项目

①、首先将项目移动到html下;
②、将ssl证书移动到目的地;
③、然后进行nginx配置;

Nginx配置文件完整代码展示(主要在server段):


#user  root;
worker_processes 1;events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;sendfile on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout 65;#gzip  on;server {listen 80;server_name test.top www.test.top;# HTTP 重定向到 HTTPSreturn 301 https://$host$request_uri;}server {listen 443 ssl;server_name test.top www.test.top;# SSL 配置ssl_certificate /usr/local/nginx/conf/ssl/test.top.pem;ssl_certificate_key /usr/local/nginx/conf/ssl/test.top.key;ssl_protocols TLSv1.2 TLSv1.3;ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';ssl_prefer_server_ciphers on;# 设置错误页面error_page 404 /404.html;error_page 500 /500.html;location = /404.html {root /usr/local/nginx/html;internal;}location = /500.html {root /usr/local/nginx/html;internal;}# 定义项目根目录root /usr/local/nginx/html;# 默认访问 项目1 【如果不想用项目1,也可以自定义其他项目】location / {try_files $uri $uri/ /项目1/index.html;#			root   html;#			index  index.html index.htm;}# 项目1 项目location /项目1 {alias /usr/local/nginx/html/项目1;try_files $uri $uri/ /项目1/index.html;}# 项目2 项目location /项目2 {alias /usr/local/nginx/html/项目2;try_files $uri $uri/ /项目2/index.html;}# 项目3 项目location /项目3 {alias /usr/local/nginx/html/项目3;try_files $uri $uri/ /项目3/index.html;}}
}

这样页面访问时就可以是:https://test.top/项目1/https://test.top/项目2/https://test.top/项目3/

一个域名配置多个项目

①、首先将项目移动到html下;
②、然后进行nginx配置;

Nginx配置文件完整代码展示(主要在server段):


#user  root;
worker_processes 1;events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;sendfile on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout 65;#gzip  on;server {listen 80;server_name test.top www.test.top;# 设置错误页面error_page 404 /404.html;error_page 500 /500.html;location = /404.html {root /usr/local/nginx/html;internal;}location = /500.html {root /usr/local/nginx/html;internal;}# 定义项目根目录root /usr/local/nginx/html;# 默认访问 项目1 【如果不想用项目1,也可以自定义其他项目】location / {try_files $uri $uri/ /项目1/index.html;#			root   html;#			index  index.html index.htm;}# 项目1 项目location /项目1 {alias /usr/local/nginx/html/项目1;try_files $uri $uri/ /项目1/index.html;}# 项目2 项目location /项目2 {alias /usr/local/nginx/html/项目2;try_files $uri $uri/ /项目2/index.html;}# 项目3 项目location /项目3 {alias /usr/local/nginx/html/项目3;try_files $uri $uri/ /项目3/index.html;}}
}

这样页面访问时就可以是:http://test.top/项目1/http://test.top/项目2/http://test.top/项目3/

本机地址配置多个项目

本机地址配置多个项目这个其实和一个域名配置多个项目是一样的,只不过把server_name的域名换成localhost就行。

具体操作如下:

①、首先将项目移动到html下;
②、然后进行nginx配置;

Nginx配置文件完整代码展示(主要在server段):


user root;
worker_processes 1;events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;sendfile on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout 65;#gzip  on;server {listen 80;server_name localhost;# 设置错误页面error_page 404 /404.html;error_page 500 /500.html;location = /404.html {root /usr/local/nginx/html;internal;}location = /500.html {root /usr/local/nginx/html;internal;}# 定义项目根目录root /usr/local/nginx/html;# 默认访问 html/下的index.html页面location / {root html;index index.html index.htm;# 如果需要以项目1为默认页,可以把这个配置打开,上面的两个注释了就行;# try_files $uri $uri/ /项目1/index.html;}# 项目1 项目location /项目1 {alias /usr/local/nginx/html/项目1;try_files $uri $uri/ /项目1/index.html;}# 项目2 项目location /项目2 {alias /usr/local/nginx/html/项目2;try_files $uri $uri/ /项目2/index.html;}}
}

这样页面访问的是时候就可以是:ip/项目1/ip/项目2/

推荐一个优化nginx配置文件的页面:Nginx配置文件格式化

这里面还有很多格式化工具可以自己看看:https://tool.okcode.vip/

Nginx 404页面美化:Nginx 404页面美化

相关文章

文章标题文章连接
【Linux】nginx基础篇 – 介绍及yum安装nginxhttps://liucy.blog.csdn.net/article/details/133928000
【Linux】环境下部署Nginx服务 - 二进制部署方式https://liucy.blog.csdn.net/article/details/132145067
nginx配置负载均衡–实战项目(适用于轮询、加权轮询、ip_hash)https://liucy.blog.csdn.net/article/details/133986013
nginx快速部署一个网站服务 + 多域名 + 多端口https://liucy.blog.csdn.net/article/details/133986102
【Linux】Nginx一个域名https&一个地址配置多个项目【项目实战】https://liucy.blog.csdn.net/article/details/144442148

相关专栏

❀《Linux从入门到精通》专栏 ❀
❀《Nginx》专栏 ❀

🐋 希望大家多多支持,我们一起进步!😄
🎉如果文章对你有帮助的话,欢迎 点赞 👍🏻 评论 💬 收藏 ⭐️ 加关注+💗

http://www.ds6.com.cn/news/13299.html

相关文章:

  • 咪咪做网站seo怎么发外链的
  • 武汉制作网站的公司百度站长工具如何使用
  • 青岛永诚网络管理有限公司网站整站优化公司
  • 海南教育学会网站建设优化seo方法
  • 网站建设方案论文写手代写平台
  • 网站建设方案大全百度一下就知道官方
  • 建筑网站的特点seo值是什么意思
  • 给你网站你会怎么做google play下载
  • 网站建设及推广衬胶蝶阀手机百度安装下载
  • 网站的设计与应用论文推广普通话ppt课件
  • 免费学做美食视频网站网站推广开户
  • 白天做彩票维护的网站店铺推广方法
  • 哪个网站专做进口商品的餐饮管理培训课程
  • 做网站程序的步骤品牌营销理论有哪些
  • 品牌百度网站建设企业策划方案怎么做
  • 自由策划企业网站管理系统破解版大连网络推广
  • 免费公司网站seo快速提升排名
  • 沈阳公司网站建设搜索引擎营销案例有哪些
  • 网站建设分析报告上海网站制作推广
  • 杭州网站建设代理商百度推广客户端app下载
  • 国外做的不错的网站青岛网站开发公司
  • 网易严选的网站建设seo修改器
  • 网站便民服务平台怎么做软文推广案例大全
  • 网站如何做担保交易平台小红书怎么做关键词排名优化
  • 万网网站购买百度搜索引擎优化方式
  • 标准页面布局网站排名seo软件
  • 昌邑做网站的公司搜狗关键词排名查询
  • 做seo 教你如何选择网站关键词电商网站排名
  • 素材下载平台网站源码2020做seo还有出路吗
  • 贵阳市做网站公司互联网营销师考试题及答案