hi. i have installed a ssh panel on my vps , but bcuz my country keep filtering th ips , i need to forward my iran vps to my digital ocean vps . my ssh panel using apache and the panel will open with this link :
but i wanna open the panel with :
t1 is the domain of my iran vps , so what i need is when someone enter t1.domain.com/p iran server forward this request to digital server and open t2.domain.com/p
i did forward my ssh port with socat so my clients can connect to digital ssh throw my iran vps server easily but bcuz this panel doesn’t have any port on the domain i don’t know how to forward it .
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
To set up the forwarding of your SSH panel from your Iran VPS to your DigitalOcean VPS using a web URL, you can use a reverse proxy setup. Since you mentioned your SSH panel is running with Apache, you can configure Apache on your Iran VPS to act as a reverse proxy that forwards requests from t1.domain.com/p to t2.domain.com/p.
Here’s a step-by-step guide on how to do this:
First, you need to ensure that the necessary proxy modules are enabled in Apache on your Iran VPS. You can do this by running the following commands:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo systemctl restart apache2
Next, you’ll need to create or edit a virtual host file for t1.domain.com. Here’s how you can set it up:
t1.domain.com, you can create one:sudo nano /etc/apache2/sites-available/t1.domain.com.conf
<VirtualHost *:80>
ServerName t1.domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass "/p" "http://t2.domain.com/p"
ProxyPassReverse "/p" "http://t2.domain.com/p"
ErrorLog ${APACHE_LOG_DIR}/t1.domain.com_error.log
CustomLog ${APACHE_LOG_DIR}/t1.domain.com_access.log combined
</VirtualHost>
This configuration tells Apache to forward any requests for t1.domain.com/p to t2.domain.com/p, while also handling the response headers so that the client’s browser behaves as if it were communicating directly with the origin server.
sudo a2ensite t1.domain.com.conf
sudo systemctl reload apache2
t1.domain.com are correctly pointing to your Iran VPS.Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.