404 Not Found /ajax/file_upload_handler

redov

New Member
Apr 23, 2024
1
0
1
I just setup the script and I am getting an error when I am trying to upload a file the error is :

equest URL:
Request Method:
POST
Status Code:
404 Not Found
Remote Address:
5.9.43.152:443
Referrer Policy:
strict-origin-when-cross-origin


the route : https://peskup.com/ajax/file_upload_handler Is not found so I checked the nginx error log :


2024/04/23 01:03:06 [error] 65954#65954: *1 open() "/var/www/peskup/ajax/file_upload_handler" failed (2: No such file or directory), client: 89.205.131.192, server: peskup.com, request: "GET /ajax/file_upload_handler HTTP/1.1", host: "peskup.com"
2024/04/23 01:03:13 [error] 65954#65954: *1 open() "/var/www/peskup/ajax/file_upload_handler" failed (2: No such file or directory), client: 89.205.131.192, server: peskup.com, request: "POST /ajax/file_upload_handler?r=peskup.com&p=https&csaKey1=5d7bd7a7693cef081ffd71adbc4fd09d7406f8f448cd2bdbb97a35e4c7577add&csaKey2=0cd6117fbded53b7644ee5c66a6d25fb626e0591f887ac5cc21201e7cbd22e49 HTTP/1.1", host: "peskup.com", referrer: "https://peskup.com/account"

my nginx conf file :

server {
if ($host = www.peskup.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = peskup.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
server_name www.peskup.com peskup.com;
# Redirect all HTTP traffic to non-www HTTPS
return 301 https://peskup.com$request_uri;
}
server {
listen 443 ssl;
server_name www.peskup.com;
# Redirect www HTTPS traffic to non-www HTTPS
return 301 https://peskup.com$request_uri;
ssl_certificate /etc/letsencrypt/live/www.peskup.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.peskup.com/privkey.pem; # managed by Certbot
}
server {
listen 443 ssl;
server_name peskup.com;
# SSL configuration
ssl_certificate /etc/letsencrypt/live/peskup.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/peskup.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /var/www/peskup/;
index index.html index.php;
charset utf-8;
client_max_body_size 5G;
# increase the timeout for uploads
location /ajax/file_upload_handler {
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
proxy_send_timeout 1800;
}
# pass the PHP scripts to FastCGI server listening on unix socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Rewrite rules for handling routes with FastRoute
location /ajax {
try_files $uri $uri/ /index.php?$query_string;
}
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?_page_url=$1 last;
}
}
# Internal location for serving files
location /files/ {
internal;
}
# Deny access to hidden files
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
# Deny access to logs directory
location /logs/ {
deny all;
}
}

I think its from nginx roles so could u guys help me becuse I tried everthig but its still not working !!
 

jfocnet

New Member
YetiShare User
YetiShare Supporter
Apr 25, 2024
3
0
1
remove these:
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
proxy_send_timeout 1800;


from :
location /ajax/file_upload_handler {
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
proxy_send_timeout 1800;
}