我有一個正常的PHP腳本監聽$ _SERVER [「REQUEST_METHOD」] 我使用PUT方法進行表單提交,但在nginx服務器上收到錯誤405 。如何允許Nginx的PUT刪除表單提交
只是想使用請求方法提交一個簡單的表單。
1 server {
2
3 listen 80; # port 80 default
4
5 root /home/user/workspace/l; # default directory where the files will be stored and served from
6
7 index index.php index.html index.htm; # index defined to be served under directory
8
9 server_name l; #name of the virtual host or domain
10
11 error_log /var/log/nginx/l.error.log;
12 access_log /var/log/nginx/l.access.log;
13
14
15 location/{
16 try_files $uri $uri/ /index.html;
17 }
18
19 # Serve PHP scripts to FastCGI server our php-fpm server listening on 127.0.0.1:9000
20
21 location ~ \.php$ {
22 fastcgi_pass 127.0.0.1:9000;
23 # With php5-fpm:
24 #fastcgi_pass unix:/var/run/php5-fpm.sock;
25 fastcgi_index index.php;
26 fastcgi_split_path_info ^(.+\.php)(/.*)$;
27 include fastcgi_params;
28 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
29 }
30 }
請求調用/index.php?groups
最初的電話是:
function updateGroup(group_name, group_id) {
values = {};
values.name = group_name;
values.id = group_id;
$.ajax({
url: '?groups',
type: 'PUT',
data: values,
success: success,
dataType: 'json'
});
}
'如果代碼== 0:打印( 「沒有幫助」)' –
是否正確地工作吧? –