Thanks for your replies and support SeritaV and ValsMum.
I went without food for a week and drank only water and was rid of AS symptoms for a while so diet does work I have no idea how and why.
However I felt so weak and exhausted I literally had to drag myself out of bed in the morning. I resumed normal diet and the pain returned within hours.