繁体   English   中英

Nginx 删除 '?' 扩展前的符号

[英]Nginx remove '?' symbol before extension

当我得到如下网址时,我设法使我的 index.php 脚本正常运行:

http://myserver.com/?something.m3u8

仍然,我需要删除? 从中。

有任何想法吗?

我的 Nginx 配置如下所示:

server {
listen 6868 default_server;

root /var/tmp/mfl;
index index.php;

# Make site accessible from http://localhost/
server_name localhost;

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
}

显然是一个单行解决方案

location / {
    try_files $uri $uri/ /index.php?$args; #appended this line 
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM