You need sleep to rejuvenate your body and feel energized for the day ahead. Yet a good night’s rest can be hard to come by when you have ankylosing spondylitis (AS).

Between 35 and 90 percent of people with AS complain of poor sleep. It’s tough to stay asleep at night when your body hurts. The more severe your disease is, the less likely you are to get the rest you need. And the less you sleep, the worse your pain and stiffness could become.

Don’t settle for disrupted sleep. See your rheumatologist and primary care doctor for advice on how to manage sleep issues. Follow these tips to help you sleep longer and more soundly.

The less pain you’re in, the easier it will be for you to sleep. Make sure you’re on the best treatment to slow your disease and manage your pain.

Nonsteroidal anti-inflammatory drugs (NSAIDs) and TNF inhibitors are two types of medications that decrease inflammation to prevent further damage to your joints caused by AS. TNF inhibitors might also help improve the quality of your sleep, research suggests.

If the drug you’ve been taking isn’t controlling your pain, see your rheumatologist. You might need a different medication or dosage.

Your bed should be both comfortable and supportive. Look for a firm mattress that keeps your body in proper alignment. Test out several mattresses in the store until you find one that feels right.

A brisk walk will get your blood pumping and wake up your muscles and joints. It will also prime your body for sleep.

Exercise improves the quality and quantity of your sleep. It will help you get more of the deep and restorative slumber your body needs to heal. You’ll also fall asleep faster if you get in a good workout that day.

The time of day you exercise is key. An early morning fitness program will help you sleep best. Working out too close to bedtime can wind up your brain to the point where you can’t fall asleep.

Warm water is soothing to sore joints. A 20-minute bath before bed will loosen up your joints and relieve pain so you can sleep more soundly.

Soaking in a warm tub will also relax your body before bed. And, if you do a few stretches while you’re in the bath, you’ll also relieve any built-up stiffness in your joints.

Lying on a thick pillow can put your head into an unnaturally hunched position when you get out of bed. You’re better off using a thin pillow.

Lie on your back and place the pillow under the hollow of your neck to keep your head in the correct alignment or sleep on your stomach and don’t use a pillow.

Try to sleep with your spine straight. You can lie flat on your back or stomach. Just avoid curling your legs up into your body.

Create optimal sleeping conditions before you slide under the sheets. Set the thermostat between 60 and 67 degrees Fahrenheit. It’s more comfortable to sleep in a cool climate than a warm one.

Pull down the shades so the sun doesn’t wake you in the early morning. Keep your bedroom quiet and put away your cell phone or other digital devices that might go off and disturb your sleep.

Snoring is a sign of obstructive sleep apnea, a condition that causes you to stop breathing for brief periods during the night. People with AS are more likely to have sleep apnea. And those with sleep apnea tend to have more damage to their spine.

Each time you stop breathing, your brain wakes you up to open your airways. As a result, you never feel fully rested during the day. If your partner or loved one says you snore or you’ve woken yourself up mid-snore, see your doctor for an evaluation.

Doctors have many ways to treat sleep aapnea. One common treatment uses a machine called CPAP (continuous positive airway pressure) that blows air into your airway to keep it open while you sleep.

If you’re living with AS and experiencing poor sleep, talk to your doctor. Based on your symptoms, they may suggest switching medications or trying some natural remedies.

To live a happy, healthy life, we all need a good night’s rest. Try these tips and follow your doctor’s recommendations to catch the Zzz’s you need.