服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. nginx
  3. 两个url指向同一个文件
Intereting Posts
Dovecot SQL身份validation:如何区分IMAP和POP3访问? LVM:“无法findUUID设备”,但blkidfindUUID 如果内存不足,则监控并自动重启Jetty RAID1上encryption的LVM – 故障testing,手动安装 如何configurationmime_content_type()函数在php5中正常工作? 使用GPO运行一次batch file 将文件夹从CentOS服务器移动到Ubuntu服务器 HAProxy:显示“BADREQ”| BADREQ的成千上万 运行2个Windows 2012安装build议的ESXi 删除不需要的文件后,如何减lessVHD / VMDK文件的“实际”大小? 为什么lp和lpr返回未授权? configuration公用文件夹的自动回复 内部IP地址显示在我的网站日志中 当我杀死一个在bash脚本中创build的subprocess时,它会自动重新生成。 为什么? 思科Multi-DMZ防火墙

两个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