{"id":3810,"date":"2016-04-19T12:42:49","date_gmt":"2016-04-19T12:42:49","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3810"},"modified":"2016-04-19T12:42:49","modified_gmt":"2016-04-19T12:42:49","slug":"apache-forward-directory-port","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/apache-forward-directory-port\/","title":{"rendered":"Apache: forward directory to port"},"content":{"rendered":"<p>To have Apache proxy requests to node, you need these modules enabled:<\/p>\n<pre lang=\"bash\">\na2enmod proxy\na2enmod http_proxy\n<\/pre>\n<p>This is what I ended up with for configuration &#8211; note how simple the ProxyPass bit is (you can&#8217;t do all this in .htaccess, it&#8217;s not worth trying).<\/p>\n<pre lang=\"xml\">\nLoadModule proxy_module modules\/mod_proxy.so\nLoadModule proxy_http_module modules\/mod_proxy_http.so\n\n<VirtualHost 173.255.224.150:80>\n      ServerAdmin gary.sieling@gmail.com\n      ServerName garysieling.com\n      ServerAlias www.garysieling.com\n      DocumentRoot \/srv\/www\/garysieling.com\/public_html\/\n      ErrorLog \/var\/log\/apache2\/garysieling-error.log\n      CustomLog \/var\/log\/apache2\/garysieling-access.log combined\n\n      ProxyRequests Off\n      ProxyErrorOverride Off\n\n      <Location \"\/search\">\n        ProxyPass \"http:\/\/127.0.0.1:3000\/search\"\n      <\/Location>\n\n      ProxyPassReverse \"\/search\" \"http:\/\/localhost:3000\/search\"\n<\/VirtualHost>\n<\/pre>\n<p>The most difficult part of this entire thing is to get slashes correct in the paths.<\/p>\n<p>You really need <a href=\"https:\/\/www.garysieling.com\/blog\/node-log-files-forever\">logging set up on node<\/a>, if you have problems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a reverse proxy in Apache: easy and hard at the same time<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[49,387,388,389,559],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3810"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3810"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3810\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}