If by any chance you are running CGI you can't assign it to the main folder of your application as files such as CSS or JS will be tried to be "Exec"-ed by Apache resulting in
AH01215: (8)Exec format error: exec of
ERROR inside /var/log/apache2/error.log
Create separate folder for executable files only and add something like this to your /etc/apache2/sites-enabled/sub.domaian.com.conf
<VirtualHost *:80>
DocumentRoot "/var/www/html/yoursite"
ServerName sub.domain.com
<Directory "/var/www/html/yoursite">
allow from all
Require all granted
</Directory>
<Directory "/var/www/html/yoursite/CGI">
Options ExecCGI
SetHandler cgi-script
</Directory>
AddHandler cgi-script .py
</VirtualHost>
Interesting enough: I had SetHandler cgi-script assign to main folder and in my situation I could open the page with no issue when I was accessing the page through LAN but not from WAN.