node.js - How to maintain get and post data in virtual host? -
i have nodejs, php , apache2 running on ubuntu 14.04.
there nodejs listening on different ports (eg. 3000, 3001...).
so, want setup virtual host, when user requests nodejs service, user can go "http://nodejs.example.com/api" instead of "http://example.com:3001/api" , @ same time, want maintain post/get data being sent.
following virtual host configuration:
#/etc/apache2/sites-available/mysite.conf <virtualhost *:80> serveradmin webmaster@localhost servername example serveralias nodejs.example.com proxyrequests off proxypreservehost on proxyvia full <proxy *> require granted </proxy> <location /> proxypass http://127.0.0.1:3001/ proxypassreverse http://127.0.0.1:3001/ rewriteengine on rewriterule http://nodejs.example.com:3001/$1 [r=301,l] </location> errorlog ${apache_log_dir}/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn customlog ${apache_log_dir}/access.log combined </virtualhost>
can please help?
Comments
Post a Comment