Answer the question
In order to leave comments, you need to log in
How to send all POST requests to index.php in nginx?
Hey! I'm making a file upload server. You need to send post requests to index.php and get to display statics.
Tell me the config please.
Answer the question
In order to leave comments, you need to log in
if ($request_method = POST) {
rewrite ^ /index.php break;
}
location = /index.php {
internal;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = / {
try_files $uri $uri/;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question