I removed the old front porch light and found that the old wiring is being run through a pipe that sticks out about 1/2”. I can’t install the new light because it needs to flush to an outlet box. Ideas?
The picture shows an armored conduit holding the wires. You could mount a box by removing the nut and mounting a box through a knockout at the back of the box, replacing the nut on the inside. You'd want to make sure it's rated for outdoor since it's exposed.
I'm not sure what type of base the light has and whether or not it will cover the box once you mount it or if that's important to you.
In this particular application code may allow you to attach the light directly to a mounting bar attached to the nipple. However, before you do that check codes. One of the electrical pros here might help you with that.
Most of the time when I don’t have a J box I will recommend a wall pack. A wall pack is a surface mounted fixture that allows the wiring splices to be made inside the fixture. These come in every light type , incandescent, LED, HID including metal halide , sodium and fluorescent. In the past they were more common on industrial buildings but with LED lighting I see them much more often.