Pufferpanel srv record



  • So I have my control panel at subdomain.example.com:4589 right now. I'd like to make this accessible by just typing subdomain2.example.com (without port). What should I use as the "service" part of my record, some pufferpanel thing or rather nginx?

    Thank you for making this amazing piece of software :D



  • SRV records don't work for http(s), so you will need to run your panel on either port 80 (http) or port 443 (https) in order to avoid typing the port. If you have multiple websites, you can make another subdomain and use the virtual hosts functionality of nginx so that both subdomain1.example.com and subdomain2.example.com are accessible without using a different port.

    You can change the subdomain for PufferPanel by editing /etc/nginx/sites-enabled/pufferpanel.conf (or /etc/nginx/conf.d/pufferpanel.conf on CentOS) and updating the server_name line.

    You'll also need to tell PufferPanel what its new subdomain is, you can do this by running the following commands.
    (as root)

    cd /srv/pufferpanel
    ./pufferpanel updatesite
    


  • Wow! You are lightning fast!

    So, the problem is, I have one webserver (I'll refer to this one as A) on 192.168.0.xxx and another one (I'll refer to this one as B) on 192.168.0.yyy.

    Server B uses several virtual hosts already. This webserver (Windows) hosts my forums, wordpress site and various other side projects (basically me teaching myself php, html, css, etc). This also has FTP (port 21) and MySQL (including phpmyadmin) installed.

    Then there's server A. This server is where I have nginx for pp, scales (yes, I run everything on one machine), and sftp (port 22) installed.

    I already have port 80 forwarded to webserver B (not port 443!). Would forwarding port 80 to webserver B and 443 to webserver A work? It could maybe cause weird behaviour with some browers, when typing in "http://example.com" this browser might detect this domain has https so it uses "https://example.com" instead, which is a total different website.

    By the way - I am running ubuntu 14.04 LTS



  • A difficult situation for sure, I would definitely not recommend running one site on 80 and another on 443 for the same reasons you listed. I think you are pretty much stuck there unless you do some fancy nginx.

    nginx is more than a web server, it's actually a really great proxy. What you could do is forward port 80 to the Linux machine and have nginx accept the connections to port 80, and then proxy certain ones to the Windows server.

    I'll give you an example here of what I mean.

    server {
        listen 80;
        root /srv/pufferpanel/;
        index index.php;
        
        server_name subdomain1.example.com;
    
        client_max_body_size 20m;
        client_body_timeout 120s;
    
        location / {
            try_files /public/router.php =404;
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index router.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
    
        location /assets {
            try_files /app/$uri =404;
        }
    
    }
    
    ## Proxy to other machine
    server {
        listen 80;
        server_name subdomain2.example.com subdomain3.example.com;
    
        location / {
            proxy_pass http://192.168.1.2:80;
            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_set_header X-Forwarded-Proto $scheme;
        }
    }
    

    I can't say I've tried this with a Windows server and you may need to add other proxied headers, but hopefully this works for you. Please let me know if you have any questions and I hope this helps.



  • Sounds great! Thanks for your help -- I'll definately try this



  • Update:

    IT WORKS :D I decided to do something else than I initially planned; I set this up on my raspberry pi. Requests will now be sent to my rpi and then passed to either server A or B



  • Glad you got it working!


Log in to reply
 

Looks like your connection to PufferPanel Community was lost, please wait while we try to reconnect.