I was nauseus and back pain for 2weeks, then sever pain 3times in the next 2weeks upper right side under ribs with other symptoms. Now vommiting. Y?

Get medical exam. Pyelonephritis is a severe infection in the kidney; it should be evaluated by a medical provider at the earliest opportunity. A kidney stone may partially or fully obstructed the kidney and cause a hydronephrosis. It to should be evaluated by a healthcare provider as soon as possible. Hepatitis of the liver is also a possibility and should be examined quickly.
Gallbladder. Altho severe spinal pain (or pain of any origin) can cause nausea, pain as you've described, especially with vomiting is characteristic of gallbladder problems. Sounds pretty significant. See you family doctor or gastroenterologist (gi specialist) soon.