A Helmholtz resonator is not sensitive to port position, so in general, you can put the port wherever you want. However, in practice, there are two considerations:1. You do not want the port to rest in a standing wave node. If it does, then the loudspeaker will be a transmission line or a reflex/pipe hybrid. If the speaker is tall and thin and the port and driver are separated by more than a couple feet, you should probably model the cabinet with Martin King's ported box spreadsheet. Insulation spanning the cross-section between woofer and port help damp standing waves too, especially if placed on a node.
2. Avoid placing the port in a position where midrange frequencies can easily enter it. Ideally, you want the stuffing in the box to attenuate everything above the range of frequencies where the port works. Careful placement of the port in relation to the woofer and insulation placed on reflective panels inside will help reduce midrange frequencies entering the port. In general, avoid putting the port right behind the woofer or near a reflective surface with angle of incidence towards the woofer.