Wiktionary
sail close to the wind
vb. 1 (context nautical English) To sail in a direction close to that from which the wind is blowing, but still making headway 2 (context idiomatic English) To behave in a manner that is on the verge of being dangerous, improper or illegal
Usage examples of "sail close to the wind".
But I also want to sail close to the wind, and for that we must have bigger fore-and-afts.