Elastic neutron diffraction measurements were performed on the quasi-two dimensional heavy fermion system CeRh1-xCoxIn5, ranging from an incommensurate antiferromagnet for low x to an unconventional superconductor on the Co-rich end of the phase diagram. We found that the superconductivity competes with the incommensurate antiferromagnetic (AFM) order characterized by qI=(1/2, 1/2, delta) with delta=0.298, while it coexists with the commensurate AFM order with qc=(1/2, 1/2, 1/2). This is in sharp contrast to the CeRh1-xIrxIn5 system, where both the commensurate and incommensurate magnetic orders coexist with the superconductivity. These results reveal that particular areas on the Fermi surface nested by qI play an active role in forming the superconducting state in CeCoIn5.