靜態頁面POST會提示405 Not Allowed錯誤.
# curl -d name=neo http://www.mydoamin.com/index.html
<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>
server {
listen 80 default;
server_name myid.mydomain.com;
charset utf-8;
access_log /var/log/nginx/myid.mydomain.com.access.log main;
if ($http_user_agent ~* ^$){
return 412;
}
###########################
location / {
root /www/mydomain.com/myid.mydomain.com;
index index.html index.php;
#error_page 405 =200 $request_filename;
}
#error_page 404 /404.html;
#
error_page 405 =200 @405;
location @405 {
#proxy_set_header Host $host;
proxy_method GET;
proxy_pass http://myid.mydomain.com;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
|