Skip to content

manishprajapatidev/proxy-pass-ip-address-to-port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Use Apache as a proxy server to access internal IPs from an external machine

Install apache2. On Ubuntu

sudo apt-get install apache2

Enable the various modules needed. You can do that with the a2enmod tool:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_ajp
sudo a2enmod rewrite
sudo a2enmod deflate
sudo a2enmod headers
sudo a2enmod proxy_balancer
sudo a2enmod proxy_connect
sudo a2enmod proxy_html

Configure Apache by editing the /etc/apache2/sites-available/000-default.conf file to read:

sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:*>
    ProxyPreserveHost On
    
    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/

    # Example: 
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    ServerName localhost
</VirtualHost>

Restart the apache2 service

sudo service apache2 restart

Enjoy :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published