Backed up. During pregnancy

I am 24 weeks and 3 days pregnant and I have chronic constipation I've been taking milk of magnesia since the beginning of the pregnancy and it's no longer working for me. I feel nauseous and backed up my doctor told me not to take miralax . I don't know what to do.