DNSMasq doesn't need to know about the web port. It only needs to talk to the dns server.
Luci runs on 80 by default. The reasoning for putting AGH on 8080 is so they don't conflict.
One thing i haven't bothered sorting out for my setup is that if you want SSL enabling you have to configure and setup both Luci and AGH and ensure they are on separate ports to avoid clashes.
As you rightly point out in your tutorial you must do a certificate and enable SSL if u want that option in AGH. I have avoided doing this as i am only serving internally. For those also using AGH externally SSL is a must.