-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploaded files do not appear in the directory #145
Comments
I spent whole night trying to fix the same issue. Just as @maro584, i gave up on using the default Things suddenly started working when I changed the line to So, I guess my advice is to implement a temporary solution, save the files into one of the nginx directories and make your backend scripts instantly move them to a better location if you plan to use nginx as a fast local proxy for testing your python/ruby/php webapp, or switch to Apache if you need a production web server, that would save you a lot of time. Honestly, it's depressing how there is little to no online help about such issues in nginx and its modules. |
Hey everyone, I also came across and managed to solve this issue. The solution was not obvious! I am assuming everyone having this issue was running NGINX through systemd- systemd does something funny, it turns out! To make sure the files are actually saved, you can either create the hashed subdirectories in the special systemd temp folder each time the nginx service launches or just use forgo hashing entirely like so:
Note that if you want to see the files with these methods, you will need to check the You can also just change your upload_store directory to a non-tmp directory like @kitamiq did! |
I used the following documentation to complete the setup:
https://www.nginx.com/resources/wiki/modules/upload/
When trying to upload via the form from the example module configuration, the file in the designated directory does not appear, the directory obviously exists and for the time of testing I gave it 777 permissions. Below are the logs generated when uploading the file:
tail -f /usr/local/nginx/logs/access.log
x.x.x.x - - [30/Jan/2023:15:50:14 +0000] "GET /upload/upload.html HTTP/1.1" 200 587 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
x.x.x.x - user [30/Jan/2023:15:50:14 +0000] "POST /upload HTTP/1.1" 301 169 "http://x.x.x.x/upload/upload.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
x.x.x.x - user [30/Jan/2023:15:50:18 +0000] "GET /upload/ HTTP/1.1" 200 277 "http://x.x.x.x/upload/upload.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
upload.html
<title>Test upload</title>Select files to upload
nginx.conf
#user nobody;
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
}
Directory z for files, despite using the configuration, is empty, the uploaded files are small, a few Kb.
nginx version: nginx/1.20.2
Red Hat Enterprise Linux release 8.7 (Ootpa)
The text was updated successfully, but these errors were encountered: