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

自适应网站开发网络营销做得比较成功的案例

自适应网站开发,网络营销做得比较成功的案例,南做网站,郑州企业网站排名优化公司第一步:通过Xshell在虚拟机中下载nginx sudo apt-get install nginx 第二步:进入nginx配置页面 cd /etc/nginx 我这里创建了一个html文件夹 在进入去创建页面并且重新加载 boahuboahu-VMware-Virtual-Platform:/$ cd /etc/nginx boahuboahu-VMware-Vir…


第一步:通过Xshell在虚拟机中下载nginx
sudo apt-get install nginx
第二步:进入nginx配置页面
cd /etc/nginx

我这里创建了一个html文件夹 在进入去创建页面并且重新加载

boahu@boahu-VMware-Virtual-Platform:/$ cd /etc/nginx
boahu@boahu-VMware-Virtual-Platform:/etc/nginx$ ls
conf.d        fastcgi_params  koi-utf  mime.types         modules-enabled  proxy_params  sites-available  snippets      win-utf
fastcgi.conf  html            koi-win  modules-available  nginx.conf       scgi_params   sites-enabled    uwsgi_params
boahu@boahu-VMware-Virtual-Platform:/etc/nginx$ cd html/
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ ls
myindex02.html  myindex.html
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ sudo vi myindex03.html
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ ls
myindex02.html  myindex03.html  myindex.html
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ sudo nginx -s reload
2025/06/20 16:15:31 [notice] 14003#14003: signal process started
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ 

第三步配置 conf.d

boahu@boahu-VMware-Virtual-Platform:/etc/nginx/html$ cd ..
boahu@boahu-VMware-Virtual-Platform:/etc/nginx$ ls
conf.d        fastcgi_params  koi-utf  mime.types         modules-enabled  proxy_params  sites-available  snippets      win-utf
fastcgi.conf  html            koi-win  modules-available  nginx.conf       scgi_params   sites-enabled    uwsgi_params
boahu@boahu-VMware-Virtual-Platform:/etc/nginx$ cd conf.d/
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/conf.d$ ls
mynginx.conf
boahu@boahu-VMware-Virtual-Platform:/etc/nginx/conf.d$ 
server {listen 8888;server_name localhost;charset utf-8;location / {root /etc/nginx/html;index myindex.html;}# 修复的精确匹配location = /login/ {alias /etc/nginx/html/;# 方法1: 使用try_filestry_files /myindex02.html =404;# 方法2: 或者使用rewrite# rewrite ^ /myindex02.html last;}# 前缀匹配location ^~ /login/ {root /etc/nginx/html;index myindex03.html;}
}
# 精确匹配
curl http://localhost:8888/login/# 前缀匹配
curl http://localhost:8888/login/test# 根目录
curl http://localhost:8888/

如果访问`/login/test`,Nginx会尝试寻找`/etc/nginx/html/login/test`文件,如果该文件不存在,且没有启用`autoindex`,就会返回404。
修复后

location ^~ /login/ {alias /etc/nginx/html/;try_files /myindex03.html =404;
}

解决方案

修改前缀匹配配置,使用 try_files 指令直接返回目标文件:

server {listen 8888;server_name localhost;charset utf-8;location / {root /etc/nginx/html;index myindex.html;}# 精确匹配/login/ → 返回myindex02.htmllocation = /login/ {alias /etc/nginx/html/;try_files /myindex02.html =404;}# 修复后的前缀匹配location ^~ /login/ {# 方案1:使用alias + try_files(推荐)alias /etc/nginx/html/;try_files /myindex03.html =404;# 方案2:或者使用root + rewrite# root /etc/nginx/html;# rewrite ^/login/.*$ /myindex03.html last;}
}
http://www.dtcms.com/wzjs/78138.html

相关文章:

  • 网站优化建设上海杭州百度推广电话
  • 哪个网站建设公司正规微商免费推广软件
  • 公司网站怎么更新维护q群排名优化软件
  • 江西城乡建设网站能翻到国外的浏览器
  • 古城网站建设微信广告推广如何收费
  • 建设广告网站需要资质吗搜索引擎优化的含义
  • 怎么做旅游网站推广重庆 seo
  • 网站备案号查电话号码乔拓云网微信小程序制作
  • 安塞网站建设网络优化工程师有多累
  • 沈阳建设工程管理中心seo网站推广批发
  • web前端面试以前都是做的小网站html网页制作案例
  • 莱特币做空国外网站磁力搜索引擎
  • 安徽 网站开发武汉seo托管公司
  • 做三网站2022最近热点事件及评述
  • 移动网站开发测试工具公司的网站制作
  • 南京江宁做网站n127网推广
  • 广州网站建设公司小程序西安快速排名优化
  • 国外上市网络公司排名怎么优化网络
  • vps网站权限有哪些网站可以免费推广
  • 基于工作过程的商务网站建设:网页制作哪有恶意点击软件买的
  • 网站怎么识别手机跳转免费网站统计代码
  • 长葛网站建设公司百度的营销推广
  • 网站标题logo修改代码百度学术官网登录入口
  • 无锡网络公司可以制作网站网站建设外包
  • 广州金融网站设计短视频运营方案策划书
  • 哈尔滨公司做网站产品怎样推广有效
  • wordpress 数据库名贵seo课程简介
  • 广州市建设工程价格信息seo助理
  • 怎么免费建设网站市场营销说白了就是干什么的
  • 可以做h5网站今日十大热点新闻事件