I have an old device that I can’t update. These clients request a web with a POST request.
They can’t handle SSL certificate so the request on my HTTPS server is made no encoded (the data are not personal)
When these clients make the POST request :
- On my personnal nginx server, no problem, the POST return a 200 HTTP Code.
- On my future apache server, the same client have a 400 HTTP Error code in return.
The only change I made is the DNS so my old device reach the new or the old server, so I think my apache setting need something to avoid these errors
Here is my nginx conf :
server {
server_name xxxxxxxxxxxxx;
root /var/www/html/xxxxxxxx;
index index.php;
client_max_body_size 100M;
access_log /var/log/nginx/xxxxxxxx_access.log;
error_log /var/log/nginx/xxxxxx_error.log;
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
}
location ~ ^/api/(.*)/(.*)/(.*) {
try_files $uri $uri/ /api.php?controlleur=$1&arg1=$2&arg2=$3;
}
location ~ ^/api/(.*)/(.*) {
try_files $uri $uri/ /api.php?controlleur=$1&arg1=$2;
}
location ~ ^/api/(.*) {
try_files $uri $uri/ /api.php?controlleur=$1;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxxxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxxx/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
}
My .htaccess apache config file :`
RewriteEngine On # Turn on the rewriting engine
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/(.*)/(.*)/(.*)$ /api.php?controlleur=$1&arg1=$2&arg2=$3 [L,B]
RewriteRule ^api/(.*)/(.*)$ /api.php?controlleur=$1&arg1=$2 [L,B]
RewriteRule ^api/(.*)$ /api.php?controlleur=$1 [L,B]``
`
Anyone knows which setting I can use to avoid the 400 http error code send by apache server ?