Basically any kind of response is at least somewhat appropriate under most circumstances. This is the main difference to "how do you do", which is so thoroughly conventionalised that an honest response would be totally unexpected and in fact not even an acknowledgement of the question is required. In German, it is still considered technically a lie if you say you are fine and you are not. Politeness can license such a lie, but especially among friends it does not require it.
The safest response if you are not in the mood to actually discuss this in detail but want to be polite is something like "Gut, und Ihnen/Dir?" Or if the person asking knows that you are not fine, you can say "Den Umständen entsprechend gut, und Ihnen/Dir?" You can try to make it clear non-verbally that you don't actually expect a response and are treating this as just a conventional greeting, but there is no absolute guarantee you will succeed. If you care about politeness less than about not hearing the other person's complaints, you might want to skip "und Ihnen/Dir?"
If you feel like it, and know the other person well and are on friendly terms with them, you might want to consider actually briefly volunteering details of why you are feeling fine, or if not, why not. (Your interlocutor can then decide whether to pursue this further or not.) Just try to remember to enquire about them afterwards to give them a chance to do likewise if they feel like it.
There are bounds to this. E.g. asking "Wie geht es Ihnen?", getting a cursory response followed by the same question, and then listing your ailments is normally considered inappropriate even by Germans. Some people actually do this in order to start a conversation on their favourite topic right away.