Skip to content
On this page

Aapanel Reverse proxy website

Website Add Site you want to use for website or subscription address.

Edit the domain and Enable SSL for the domain.

Website -> Domain -> Conf -> SSL

Add a reverse proxy

Website -> Domain -> Conf -> Reverse proxy

Proxy name : Any name you want.

Target URL : Your main XMPlus website address. https://www.xmplus.dev

Sent Domain : Same as XMPlus website without the scheme www.xmplus.dev

Click Submit to add Reverse proxy

Now Click on Conf and add this line below

proxy_ssl_server_name on;
proxy_set_header X-Forwarded-Host $host;

Click Save.

Add this to your config. Replace www.xmplus.dev with your main website you install XMPlus on address

location ^~ /
{
    proxy_ssl_server_name on;
    proxy_pass https://www.xmplus.dev; #Authorize domain website
    proxy_set_header Host www.xmplus.dev; #Authorize domain 
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;
    #Persistent connection related configuration

    #add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache
}

Save and restart nginx

systemctl restart nginx

To set it as SubUrl address, edit your XMPlus config in /www/wwwroot/domain.com/config/config.php

# Subscription address; without http:// or https://
$_ENV['SubUrl'] = "sub.xmplus.dev";