0

is there a way to proxy URL to another port in apache? For example I would like to (reverse) proxy URL:

http://*.localhost/engine.io/?EIO=2&transport=polling

from port 80 to port 8080 without changing url:

http://*.localhost:8080/engine.io/?EIO=2&transport=polling

Thank you!

Kamil
  • 1,633
  • 2
  • 21
  • 24

1 Answers1

1

In your *.localhost (port 80) vhost, add:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(.*)$
RewriteRule ^/engine\.io/$ http://%1:8080/engine.io/?%{QUERY_STRING} [L,P]
Kamil
  • 1,633
  • 2
  • 21
  • 24
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • @kamylko You can't use a wildcard with `ServerName`, you need `ServerAlias`. See: http://httpd.apache.org/docs/2.2/vhosts/name-based.html – Jon Lin Oct 23 '13 at 07:17
  • I am affraid that these rewrite conditions somehow interfering with zend project .htaccess or something. – Kamil Oct 23 '13 at 07:51