PCB board to board connector with thin footprint
You can just put plated half holes on the edge of the small board and then solder it directly to the large board.  This skips having a connector all-together.
Many board manufacturers (even cheap ones such as PCB way) can do this.
https://www.pcbway.com/pcb_prototype/What_are_Plated_Half_Holes_Castellated_Holes_.html

Some examaples of this being done on commercial modules are...

Microchip MRF24J40MA wireless module.  As you can see there are plated solder contacts on the edge of the board.
https://www.microchip.com/wwwproducts/en/MRF24J40MA

HOPERF RFM75W wireless module.  Here they put both a plated half hole and through hole on each contact, so you can solder either directly to a board or to a header.
https://www.hoperf.com/modules/2.4g/RFM75.html