If my workpalce blocks me from accessing port 8080.

Discussion in 'Installation/Configuration' started by neumann, Feb 21, 2023.

  1. neumann

    neumann Member

    How can I make a workaround if my workplace has set a port rule that blocks outgoing port 8080, so that I can't access my ispc from work.
    Ports 80 and 443 are not blocked. But I allready use port 80 and 443 for the sites setup im ispc. I am not able to get yet another ip address.

    Any ideas? :)

    Can it be done with a dedicated domain just for ispc, and then use port 80 for that domain?
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    You can create a vhost with the following:

    Code:
    <VirtualHost *:443>
            SSLEngine on
    
            SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
            SSLHonorCipherOrder on
            SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!CBC
    
            SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
            SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
    
            Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    
            ServerName panel.domain.tld
            ServerAlias www.panel.domain.tld
    
            SSLProxyEngine on
            ProxyPreserveHost On
            ProxyRequests Off
            ProxyVia Off
            ProxyPass / https://localhost:8080/
            ProxyPassReverse / https://localhost:8080/
    </VirtualHost>
    
    Or do it without the SSL Stuff and change to *:80
     
  3. remkoh

    remkoh Active Member HowtoForge Supporter

    If you're using the same server to host websites on port 80 and 443 you could create a website in ISPConfig and proxy to http://localhost:8080
    If you don't host anything on port 80 and 443 you could change your ISPConfig vhost to run on port 80 and 443.
    Using whatever option with port 443 and certificates is highly prefered when connecting over the internet.
     
  4. neumann

    neumann Member

    I do allready host other sites on the server. I'm struggling to make it work. So far no luck. :)
     
  5. neumann

    neumann Member

    in ispc I make a site called panel.bnjpro.dk and for this site in redirect tab I choose proxy as type, and what should the path be?
    I tick ssl and letsencrypt, no auto subdomain, no php. in domain tab.
    In option tab I enable proxy protocols, and insert
    ProxyPass / https://freja.bnjpro.dk:8080/
    ProxyPassReverse / https://freja.bnjpro.dk:8080/
    in proxy snippets.

    If I have set ssl and LE, do I have to put in all the virtual host stuff?
    By the way I have made an A record with panel.bnjpro.dk in DNS.
     
    Last edited: Feb 22, 2023
  6. remkoh

    remkoh Active Member HowtoForge Supporter

    What you've done so far should be enough.

    When your server resolves freja.bnjpro.dk does it resolve to 127.0.0.1 or local lan ip?
    Or does it resolve to an internet ip?
    If the last then bypass it using an entry in /etc/hosts.
     
  7. neumann

    neumann Member

    Ok got it working with some tweaks:
    -Made the website panel.bnjpro.dk
    -Made A record for it in DNS
    -Gave it ssh and then letsencrypt in domain tab, no php, no autosubdomain
    -In Redirect tab I ticked the rewrite HTTP to HTTPS - No path, no flags
    -In Option tab I put these Apache directives:
    Code:
            Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    
            ServerName panel.bnjpro.dk
            ServerAlias www.panel.bnjpro.dk
    
            SSLProxyEngine on
            ProxyPreserveHost On
            ProxyRequests Off
            ProxyVia Off
            SSLProxyVerify none
            SSLProxyCheckPeerCN off
            SSLProxyCheckPeerName off
            SSLProxyCheckPeerExpire off
    
    
            ProxyPass / https://freja.bnjpro.dk:8080/
            ProxyPassReverse / https://freja.bnjpro.dk:8080/
    
    
    
    I had a proxy error before I used these directives:
    But I'm sure it doesn't matter since it's all happening on the same server, which is with LE certificates both for the panel and the ispc it is proxying.
    If you see any bad things in the setup, feel free to enlighten me. :)
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    These lines should be removed:

    ServerName panel.bnjpro.dk
    ServerAlias www .panel.bnjpro.dk

    as they are set by the website itself already.
     
  9. remkoh

    remkoh Active Member HowtoForge Supporter

    That probably because of
    Code:
    ProxyPreserveHost On
    With that you're sending hostname panel.bnjpro.dk to the proxied freja.bnjpro.dk site.
    Hostname panel.bnjpro.dk most likely isn't part of freja.bnjpro.dk's certificate and therefor generates an error.

    To simplify things it should be enough to have only your first line in Options tab in Apache directive.
    And in Redirect tab
    Redirect type: proxy
    Redirect path: https://freja.bnjpro.dk:8080/
    Rewrite HTTP to HTTPS checked
     
  10. neumann

    neumann Member

    Done!

    Thanks :)


    I'll try to play a little with that later today.

    Thanks :)
     

Share This Page