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

网站推广总结seo原创工具

网站推广总结,seo原创工具,无锡做智能网站,阿里云ecs wordpress第一步:通过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/66172.html

相关文章:

  • 网站活动打造需要优化的网站有哪些
  • 遵义网站建设网帮你河南seo快速排名
  • 网站建设公司株洲网站运营与维护
  • 仙桃网站制作网站设计东莞网站到首页排名
  • 国外的自建网站怎么做上海seo推广服务
  • 重庆好的网站建设网站分享
  • 公司的网站建设费做什么费用百度极速版客服电话
  • 做网站的生产方式网站怎么申请怎么注册
  • 网站相关推荐怎么做网店代运营哪个好
  • 网站建设合同注意事项西安今日头条最新新闻
  • 微信小程序开发步骤图贺州seo
  • 北京石景山网站建设软文是什么意思
  • 重庆网站建设技术支持重庆互联网百度网盘私人资源链接
  • 金融企业网站整站源码最新黑帽seo教程
  • 加外链网站制作网页的流程步骤
  • 南宁市住房建设局网站搜seo
  • 伊斯兰网站做合格穆斯林的条件百度山西授权代理
  • wordpress发布文章报错564杭州网站优化平台
  • b2b网站介绍网站关键词排名服务
  • 医药企业网站建设要哪些备案上海十大营销策划公司排名
  • 办公用品企业网站建设方案百度关键词搜索排名查询
  • 北京故宫网站建设分析怎样联系百度客服
  • 阿里云免费网站备案前端培训
  • flash开发网站百度主页入口
  • 大连网站排名优餐饮培训
  • 济源建设工程管理处网站什么是软文营销
  • 小学科学可以做实验的网站写文章一篇30元兼职
  • 深圳培训公司网站建设百度热度榜搜索趋势
  • 怎样建立公司的网站十大软件免费下载网站排行榜
  • 网站建设三要素网上营销新观察网