There’s a (in my opinion) slightly easier alternative:
- Configure your Apache to listen on a different port.
- Set up nginx as a reverse proxy as described above.
- Set up nginx to proxy the non-Discourse traffic to Apache’s port.
Note that if you want HTTPS (and you do want that), in that case, you’ll have to set this up in nginx.