Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Reverse Proxy to other Servers Domain

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
learry
Posts: 1
Joined: Sat Mar 09, 2019 10:35 am

Os: CentOS 6x
Web: nginx + php-fpm
Reverse Proxy to other Servers Domain
  • Quote

Post by learry » Sat Mar 09, 2019 10:44 am

Hi,

I want use Vestacp with Nginx as Reverse Proxy.
I have 2 Server with 2 Domains. I want, if i visit the reverse proxy Domain, display the Script from second Domain.

Things i have done:

Created 2 Files under "/usr/local/vesta/data/templates/web/nginx" :


reverseproxy.stpl

Code: Select all


    server {
    listen      %ip%:%proxy_ssl_port%;
    server_name %domain_idn% %alias_idn%;
    ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;
    error_log  /var/log/%web_system%/domains/%domain%.error.log error;

    location / {
        proxy_pass      https://seconddomainwhatiwantdisplay.com/;
    }

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location @fallback {
        proxy_pass      https://%ip%:%web_ssl_port%;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include %home%/%user%/conf/web/snginx.%domain%.conf*;
}

reverseproxy.tpl

Code: Select all

server {
    listen      %ip%:%proxy_port%;
    server_name %domain_idn% %alias_idn%;
    location / {
        rewrite ^(.*) https://%domain_idn%$1 permanent;
    }
}
I have choose the correct "reverseproxy" Theme for the Domain and have restart the nginx service, but nothing changed.

I work the first time with vestacp and reverse proxy, whats wrong?

Many Thanks
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Reverse Proxy to other Servers Domain
  • Quote

Post by mehargags » Sun Mar 10, 2019 4:43 am

reexplain what you want to achieve calling them ServerA SiteA and ServerB SiteB
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password