Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-17, 21:58:46

Author Topic: I want to redirect subdomain to a different VPS server however all are on 1 IP  (Read 4912 times)

0 Members and 1 Guest are viewing this topic.

Offline hanson

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Hi Fellows,

I have searched but could not find a solution yet.  I am running on 1 External IP address 107.78.90.XX  which maps to my internal Kloxo VPS IP 192.168.1.2 www.example.com and want to redirect a kloxoMR subdomain (kaltura.example.com to another local VPS 192.168.1.24 running kaltura.    Previously, i had multiple external static IPs and set up ISP router to route each Exteranl IP to each local host.  What is the best way to accomplish this challenge using Kloxo so my subdomains are accessible from outside the network?  Thanks in advance.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Use 'redirects' for certain domain.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline hanson

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
I tried the redirect and specified 192.168.10.24/start/index.php as the Redirected Location but it does not work.  I have heard others use nginx reverse prxoy but I am not sure of the steps of doing that within kloxo.  http://serverfault.com/questions/491705/subdomains-direct-to-different-web-servers-behind-single-public-ip-address?rq=1

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
You mean redirect using IP instead domain?. I think it's doesn't work.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Alternatively, use php code like '<?php header('Location: http://www.example.com/');?>
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline hanson

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Yes i want to redirect using local IP 192.168.1.X  Where will i place the php code.  Did you review the nginx reverse proxy solution from link above if that applies with kloxo?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Can't redirect for IP address. Add the code to top of index.php in document root.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline hanson

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Let me rephrase:
I have two separate web servers (VPSes) with two different internal IP addresses on a network with only one public IP address. One is Kloxo VPS www.domain.com and the other VPS is a kaltura server kaltura.domain.com.

I have domain and subdomain configured in for www.domain.com and kaltura.domain.com both pointing to the same public IP. I need both of these to point to the correct internal server both on port 80.  Currently i cannot access kaltura box from outside.

What nginx config file if any should i modify in kloxo to do nginx reverse proxy?

Offline hanson

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Found a simple solution here:
 
https://whatididtodowhatidid.wordpress.com/2014/03/14/subdomains-for-ports-on-same-ubuntu-server-with-nginx-reverse-proxy/comment-page-1/#comment-9

modify /etc/nginx/conf.d/servers.conf or create file if it does not exist

server {
        listen 80;
        server_name domain.com;
        location / {
                proxy_pass http://localhost:7070;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_connect_timeout 150;
                proxy_send_timeout 100;
                proxy_read_timeout 100;
                proxy_buffers 4 32k;
                client_max_body_size 8m;
                client_body_buffer_size 128k;
        }
}
server {
        listen 80;
        server_name subdomain.domain.com;

        location / {
                proxy_pass http://192.168.X.X:3000;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_connect_timeout 150;
                proxy_send_timeout 100;
                proxy_read_timeout 100;
                proxy_buffers 4 32k;
                client_max_body_size 8m;
                client_body_buffer_size 128k;
        }
}
« Last Edit: 2016-08-15, 17:26:33 by hanson »

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.046 seconds with 19 queries.

web stats analysis