服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. nginx
  3. 两个url指向同一个文件
Intereting Posts
在线调整ext2 – Bug? DNS免费XP工作站和AD? 在postgres中创build数据库时出错 用于在Microsoft ActiveDirectory中检索和修改多值属性的工具 在共享主机上安装APC / eaccelerator和Memcached php-extensions init永远不会收获僵尸/已经停止的进程 MongoDB查询 固件升级后,活力2960不会启动 映射LUN以驱动MSA2312i上的插槽? Autounattend.xml用于定制install.wim(基于Windows 7) 根据子域映射请求 Windows XP支持多个远程login会话(RDP)? 我的服务器设置在哪里(用于备份) .htaccess否认所有不起作用? 无法使用域名而不是静态IP

两个url指向同一个文件

我需要两个URL来指向使用nginx的同一个php文件。 我该怎么做呢?

例:

api.example.com/users => /var/www/public_html/index.php/users example.com/api/users => /var/www/public_html/index.php/users 

我尝试着:

 location ~ ^/api/(.*)$ { try_files $uri $uri/ /index.php?$1; } 

这将“/ api /”添加到请求url。 这怎么能防止呢?

  • 试图在nginx中设置虚拟主机,域指向默认
  • 在nginxconfiguration中处理多个服务器块
  • 如何configurationnginx重写规则来剥离单页JS应用程序的索引页面,并将非哈希URLredirect到散列URL?
  • nginx作为代理多个虚拟主机
  • Nginx一个域的多个应用程序

  • PHPfile upload失败的大文件
  • Upstart显示不存在的进程运行
  • FreeBSD Ngnix安装错误
  • nginx – php5-fpm – woocommerce =>设置不保存 – 只有在重新启动php5-fpm后
  • Nginx的404错误页面的PHP与PARAMS
  • 仙人掌graphics不工作
  • 安全地configurationphp的nginx
  • Nginx在proxy_pass上的erorr_page?
  • Nginx代理上游caching?
  • nginx为googlebot提供不同的html文件
  • Nginx重写目录到Symfony App,但删除主机目录
  • Nginx用Simple Machines Forum重写
  • nginx与fail2ban和mod_security
  • Nginx:禁止URL中的index.html
  • Nginx – 在HTTPS上添加一个尾部的斜杠到URL

  • © 2017 服务器 Gind.cn
  • Topics
  •        
  • Powered by Server
  • Privacy Policy