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 General Discussion Debian/Ubuntu
  • Search

redirecting the default website to panel login page

Debian/Ubuntu related topics
Post Reply
  • Print view
Advanced search
5 posts • Page 1 of 1
eagles051387
Posts: 40
Joined: Mon Dec 22, 2014 1:29 pm

redirecting the default website to panel login page
  • Quote

Post by eagles051387 » Mon Dec 22, 2014 1:33 pm

I have nginx acting as a reverse proxy to apache. If I go to panel.domain.com for example it takes me to a clients website instead. What do I need to do to be able to redirect that to the vesta cp login page instead?
Top

drMacFaulty
Posts: 88
Joined: Thu Mar 06, 2014 7:52 pm
Contact:
Contact drMacFaulty
Website

Re: redirecting the default website to panel login page
  • Quote

Post by drMacFaulty » Sun Dec 28, 2014 7:42 pm

Have you deleted default.domain? Everything incorrect will normally be redirected here (because it was first in the list). You can redirect them by creating a config file in /etc/nginx/conf.d (Debian location) with the name 000-default or any other digit that is smaller than the other files in there (this ensures it will be loaded first) and make in that server block inside the file you created a redirect to your vesta panel domain.

For example:

Code: Select all

server {
    listen 80;
    # Make server_name invalid, so that it doesn't match anything you already defined
    server_name _;
    
    # Redirect without query string
    return 301 http://your-panel-domain-name-here.com;
    # Redirect with query string
    return 301 http://your-panel-domain-name-here.com$request_uri;
}
Source: http://wiki.nginx.org/HttpRewriteModule#return

Hope this helps
Top

eagles051387
Posts: 40
Joined: Mon Dec 22, 2014 1:29 pm

Re: redirecting the default website to panel login page
  • Quote

Post by eagles051387 » Wed Dec 31, 2014 8:16 am

I have nginx as a reverse proxy not Do I still need to put a virtual host there or at apache as apache is the default webserver
Top

drMacFaulty
Posts: 88
Joined: Thu Mar 06, 2014 7:52 pm
Contact:
Contact drMacFaulty
Website

Re: redirecting the default website to panel login page
  • Quote

Post by drMacFaulty » Tue Jan 27, 2015 7:18 pm

eagles051387 wrote:I have nginx as a reverse proxy not Do I still need to put a virtual host there or at apache as apache is the default webserver
The web browser of the client talks to Nginx (as Apache is the back-end application server). So I still recommend to use it on the Nginx side. Though, if you wish, you can also add an Apache virtualhost.
Top

eagles051387
Posts: 40
Joined: Mon Dec 22, 2014 1:29 pm

Re: redirecting the default website to panel login page
  • Quote

Post by eagles051387 » Wed Jan 28, 2015 6:54 am

drMacFaulty wrote:Have you deleted default.domain? Everything incorrect will normally be redirected here (because it was first in the list). You can redirect them by creating a config file in /etc/nginx/conf.d (Debian location) with the name 000-default or any other digit that is smaller than the other files in there (this ensures it will be loaded first) and make in that server block inside the file you created a redirect to your vesta panel domain.

For example:

Code: Select all

server {
    listen 80;
    # Make server_name invalid, so that it doesn't match anything you already defined
    server_name _;
    
    # Redirect without query string
    return 301 http://your-panel-domain-name-here.com;
    # Redirect with query string
    return 301 http://your-panel-domain-name-here.com$request_uri;
}
Source: http://wiki.nginx.org/HttpRewriteModule#return

Hope this helps
Would you mind giving an example obviously with dummy data of what this should look like as I am a bit lost since I am more familiar with apache
Top


Post Reply
  • Print view

5 posts • Page 1 of 1

Return to “Debian/Ubuntu”



  • 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