I'm working on a small react login modal.
The problem I'm facing is that when I use
axios.post('/login', { username, password })
I just get a generic nginx error from ddev (https://github.com/drud/docker.nginx-php-fpm-local/blob/master/files/usr/share/nginx/html/40x.html)
I checked both php-fpm
and nginx
logs without any useful information.
I have no idea what may be the issue, but follows the config file in use:
map $http_x_forwarded_proto $fcgi_https {
default off;
https on;
}
server {
listen 80;
listen [::]:80 default ipv6only=on;
root $NGINX_DOCROOT/public;
index index.php index.htm index.html;
server_name _;
sendfile off;
error_log /var/log/nginx/error.log info;
access_log /var/log/nginx/access.log;
location / {
absolute_redirect off;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files try_files $uri $uri/ /index.php$is_args$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_intercept_errors on;
# fastcgi_read_timeout should match max_execution_time in php.ini
fastcgi_read_timeout 10m;
fastcgi_param SERVER_NAME $host;
fastcgi_param HTTPS $fcgi_https;
}
location ~* \.(?:rss|atom)$ {
expires 1h;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* /\.(?!well-known\/) {
deny all;
}
location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
deny all;
}
location ^~ /system/files/ {
log_not_found off;
access_log off;
expires 30d;
try_files $uri @rewrite;
}
location /healthcheck {
access_log off;
stub_status on;
keepalive_timeout 0; # Disable HTTP keepalive
return 200;
}
error_page 400 401 /40x.html;
location = /40x.html {
root /usr/share/nginx/html;
}
location ~ ^/(fpmstatus|ping)$ {
access_log off;
stub_status on;
keepalive_timeout 0; # Disable HTTP keepalive
allow 127.0.0.1;
allow all;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm.sock;
}
}
Thanks in advance!
This should work without issues starting with ddev v1.8.0, as the offending nginx 40x handling was removed in https://github.com/drud/ddev/pull/1555 - Thanks for the community PR @AronNovak.