2015-03-02 68 views
0

在Apache中(不支持mod_rewrite)我可以利用URI的像這樣的:NGINX路徑分隔符/解析

/module/erp/service.php/application/workorder/list?start=0&limit=25 

我有什麼配置或更改nginx的支持呢?

server { 
     listen 80; 

     root /usr/share/nginx/www/web/public; 
     index index.php index.html; 

     server_name apps.mydomain.com; 

     location/{ 
       try_files $uri $uri/ /index.html; 
     } 


     #error_page 404 /404.html; 
     #error_page 500 502 503 504 /50x.html; 
     #location = /50x.html { 
     #  root /usr/share/nginx/www; 
     #} 

     location ~ \.php$ { 
       fastcgi_split_path_info ^(.+\.php)(/.+)$; 
       fastcgi_pass unix:/var/run/php5-fpm.sock; 
       fastcgi_index index.php; 
       include fastcgi_params; 
     } 

} 

有人可以告訴我可能需要添加什麼才能達到此要求嗎?

P.S,我需要填充$ _ SERVER [ 'PATH_INFO']就像​​在Apache存在,以及...

編輯|

我相信我發現我的答案在這裏:

https://askubuntu.com/questions/164627/nginx-php-fpm-access-denied-error

然後我遇到了 「拒絕訪問」,這聽起來像是決心是在這裏:

https://askubuntu.com/questions/164627/nginx-php-fpm-access-denied-error

任何想法?

回答

0

確定我上面提供的鏈接讓我通過解決奇數URI配置問題的過程。

的問題是我讀建議,這是一個間隙安全漏洞的cgi.fix_pathinfo = 0

大多數文章 - 在一個可能有上傳的情況。我沒有啓用上傳。

http://wiki.nginx.org/PHPFcgiExample

安全的權衡?也許...在我看來,它並不像Apache那樣重要。