I know this is an old post, but I've been trying to get this to work and struggled using the project settings.
To get it to work for me, with a background of 1080 x 1920 in portrait mode, I did the following:
In Project settings/Display/Window - width = 540 Height = 960
Add a script to the base node (if you don't have one).
In the _ready()
function add the line: get_tree().set_screen_stretch(2,1,Vector2(540,960),.5)
This is setting the shrink value in the display settings to .5, which you can't do in the editor (well not in 3.2.1)
UPDATE: I posted on the Godot features forum and some said, so it like this:
In settings, under Display/Window:
Width: 1080
Height: 1920
Test Width: 540
Test Height: 960
Mode: Viewport
Aspect: Keep
Shrink: 1