zoukankan      html  css  js  c++  java
  • nginx try_files 举例详解

    基本语法:   try_files file1[file2 file3 ...] uri    或  try_files  file1 [file2 file3 ...]  = code

    解释:    file :文件或文件路径(文件夹) uri:默认文件  code:状态码      连起来就是:试图寻找文件(或文件夹)file1,如果找到则返回,如果没找到紧接着寻找file2,file3...,        若果都未找到,则返回默认文件uri(第二种code为返回状态码)

    关于vue配置解释:vue去除#号,除了前端作修改,服务器端也要作相应的修改,具体为-在location 里加上try_files $uri $uri/ /index.html

    $uri:nginx 一个参数,其代表的是域名后到问号之间的这一部分,比如:www.xxxx.com/index.php?a=1&b=2,那么$uri = index.php

    举例:http://www.xxxx.com/case/goods?type =1 & page =2; $uri 就是case/goods,这个时候系统就会去找$root/case/goods($root就是你nginx配置的root /xxx/xxx/),没有goods文件,继续找case/goods这个目录,也没找到,这时候直接返回index.html文件给浏览器,浏览器根据url再进行处理

  • 相关阅读:
    Android Canvas save() restore()
    Android Custom View
    Android Canvas drawArc()
    每日一记--2014.9.15
    每日一记--2014.9.14
    每日一记--2014.9.13
    每日一记--2014.9.12
    每天一记--2014.9.11
    每日一记,今天开始
    java中的Iterator和Iterable
  • 原文地址:https://www.cnblogs.com/milkone/p/9983260.html
Copyright © 2011-2022 走看看