I am unable to upload a file with NGiNX because it uses the wrong URL
Here are the errors:
15247 2013/08/16 02:25:46 [error] 14363#0: *439 failed to create output
file "/var/tmp/fuploads/6/0000000006" for
"2000px-Crystal_Clear_app_help_index.svg.png" (2: No such file or
directory), client: IP, server: maindomain.com, request: "POST /upload
HTTP/1.1", host: "maindomain.com", referrer:
"http://maindomain.com/testup.php"
15248 2013/08/16 02:25:46 [info] 14363#0: *439 client sent invalid method
while reading client request line, client: IP, server:
www.otherdomain.com, request:
"^@6Ó<94>Õª;=Í^K^FçWè>÷^B½ç^$ÝÚª¶Cêt^@?Û<85>w=^Hku^W#I<92>$IûÍC)<92>$<8d>¡<8f>@{^]¾#<80>ÿ
Here is my config:
server {
listen 80;
server_name maindomain.com;
root /var/www/somefolder/maindomain.com/public/;
include /var/nginx/general/php;
include /var/nginx/general/error_page_50x;
upload_resumable on;
upload_progress_json_output;
location @frontcontroller {
rewrite ^ /upload.php last;
}
location = /progress {
report_uploads uploads;
}
location /upload {
# Pass altered request body to this location
# Specifies location to pass request body to. File fields will
be stripped and replaced by fields, containig necessary
information to handle uploaded files.
upload_pass @frontcontroller;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9
should exist
upload_store /var/tmp/fuploads 1;
# Allow uploaded files to be read only by user
upload_store_access user:r group:r all:r; ### Need to change
or check "user"
# Set specified fields in request body
upload_set_form_field $upload_field_name.name
"$upload_file_name";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
# Inform backend about hash and size of a file
upload_aggregate_form_field $upload_field_name.sha1
"$upload_file_sha1";
upload_aggregate_form_field $upload_field_name.size
"$upload_file_size";
# This directive specifies any extra POST fields which should
be passed along.
#upload_pass_form_field "^usession$";
upload_cleanup 400 404 499 500-505;
# This directive is soft limit for file size that can be uploaded
upload_max_file_size 2048m; # 2GB in Megabytes
# This directive is hard limit for file max size that can be
uploaded
client_max_body_size 2048m; # 2GB in Megabytes
track_uploads uploads 5s;
}
location = /file {
eval_escalate on;
eval_override_content_type text/plain;
eval $token {
proxy_pass http://127.0.0.1;
}
if ($token = "false")
{
# Error page
}
#proxy the file
}
}
Here is my HTML of my uploader:
<!DOCTYPE HtMl>
<html>
<head>
<meta charset="utf-8"/>
<title>Test upload</title>
</head>
<body>
<h2>Select files to upload</h2>
<form name="upload" method="POST" enctype="multipart/form-data"
action="/upload">
<input type="file" name="file1"/><br/>
<input type="file" name="file2"/><br/>
<input type="file" name="file3"/><br/>
<input type="file" name="file4"/><br/>
<input type="file" name="file5"/><br/>
<input type="file" name="file6"/><br/>
<input type="submit" name="submit" value="Upload"/>
<input type="hidden" name="test" value="value"/>
</form>
</body>
</html>
When I try to upload a file or multiple files I get redirected to
"maindomain.com/upload" but I get a error on the page. Here is the
message:
An error occurred.
Sorry, the page you are looking for is currently unavailable. Please try
again later.
If you are the system administrator of this resource then you should check
the error log for details.
Faithfully yours, nginx.
So why am I getting a error saying that another domain name was called on
the second error line (otherdomain.com I own it)?
Details about my setup: - Ubuntu 12.10 (Quantal Quetzal) - nginx-1.2.7 - I
am using this add-on: http://wiki.nginx.org/HttpUploadModule
No comments:
Post a Comment