in my /etc/nginx/sites-enabled/devdb.easy-ads.com
I have:
server {
root /srv/http/devdb.easy-ads.com/www;
index index.html index.htm index.nginx-debian.html index.php;
server_name devdb.easy-ads.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
error_page 404 = /index.php;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/devdb.easy-ads.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/devdb.easy-ads.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
and this works fine for non-404 uris, and it works fine for GET requests regardless of it being 404 or not, but all 404 POST requests are converted to GET requests before being sent off to index.php, how do i stop that? on the php-side, $_POST
is an empty array even when it shouldn't be, and $_SERVER['REQUEST_METHOD']
erroneously contains GET
...