0

I am running my main website (e.g. main.com) on a MacMini Server with OS X 10.10 and Server App Version 4. In addition, I serve a Django powered web app on a Raspberry Pi using Gunicorn and nginx. Now, I like to make the web app available from a subdomain (e.g. webapp.main.com) or alternatively from a different path like main.com/webapp.

I understand that the requests on port 80 will be handled by the web server on the MacMini. So it's a matter of redirecting the request from there to the Raspberry Pi server. How can I do this redirect or is my setup maybe too messy?

  • You could easily do that with a HTTP status code 301 - are you more inclined to enable PHP to code that or mod_rewrite and an .httpaccess file in the main.com/webapp folder on disk? – bmike Feb 17 '16 at 0:00
1

OS X Server uses Apache which is a very flexible application. OS X Server does provide you with the ability to setup redirects (https://help.apple.com/serverapp/mac/5.0/#/apd1AB74EDF-C5B3-4C20-AD02-42120FF3B208) If those settings are not sufficient and you are willing to tackle apache configuration files, there are additional options available to you.

Tutorial on Apache Redirects (https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx)

If you do a google search for "Apache configuration redirect" you'll find a lot more information on the topic.

0

If I understand your question correctly you don't have to involve redirection. Simply use the DNS server (as part of the OS X Server package) and use an alias/CNAME:

webapp.main.com -> raspberry.main.com (or whatever the FQDN of the raspberry host is):

raspberry.main.com.  IN A         192.168.0.5
webapp.main.com.     IN CNAME     raspberry.main.com.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .