org-src-preserve-indentation to nil and
org-edit-src-content-indentation to 0.
org-src-preserve-indentation preserves the indentation of the source code in the src edit buffer that you get when you call
org-edit-src-code on the source block also in the org buffer.
org-edit-src-content-indentation is the relative indent of the source code w.r.t. beginning of
You can align existing source code by selecting a region containing the source code and pressing TAB. That key is bound to the command
org-cycle calls the global binding for TAB if it does not find any special org stuff -- such as a headline -- on the current line.
If you edit the source code anyway you can also align the source code by:
- calling special edit on the source block via C-c ',
- aligning the source code in the source edit buffer such that it starts at the line beginning, (that is most probably done while editing the source code)
- returning to the org buffer by pressing C-c ' again.