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

时间:2018-10-07 17:10:28

标签: regex nginx

当我获得如下网址时,我设法使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;
}

1 个答案:

答案 0 :(得分:0)

显然是单行解决方案

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