Name based virtual hosting on non-routable IPs Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Come Celebrate our 10 Year Anniversary!Apache 2.2.14: SSLCARevocation locationSSL, Apache, and Subdomains on a Static IPfirst time setting up ssl, tutorials haven't been too helpfulWhy I am getting “Problem loading the page” after enabling HTTPS for Apache on Windows 7?SSL certificate proxy redirect to port mongrel rails app helpLive site with ssl enabled redirects to the staging site without sslConfiguring Apache reverse proxyVirtual hosts with port 80 & 443 not workingHow to Check if a SSL Certificate is successfully renewedNginx reverse proxy to many local servers + webserver duty

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

Why isn't everyone flabbergasted about Bran's "gift"?

Is Diceware more secure than a long passphrase?

As an international instructor, should I openly talk about my accent?

Multiple options vs single option UI

Is a 5 watt UHF/VHF handheld considered QRP?

Israeli soda type drink

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

Implementing 3DES algorithm in Java: is my code secure?

Is Bran literally the world's memory?

Retract an already submitted recommendation letter (written for an undergrad student)

Multiple fireplaces in an apartment building?

Does Mathematica have an implementation of the Poisson binomial distribution?

Suing a Police Officer Instead of the Police Department

What is this word supposed to be?

How to translate "red flag" into Spanish?

What do you call the part of a novel that is not dialog?

What is a 'Key' in computer science?

Why did C use the -> operator instead of reusing the . operator?

Is there any hidden 'W' sound after 'comment' in : Comment est-elle?

Can you stand up from being prone using Skirmisher outside of your turn?

Would reducing the reference voltage of an ADC have any effect on accuracy?

Why does the Cisco show run command not show the full version, while the show version command does?

Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?



Name based virtual hosting on non-routable IPs



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!Apache 2.2.14: SSLCARevocation locationSSL, Apache, and Subdomains on a Static IPfirst time setting up ssl, tutorials haven't been too helpfulWhy I am getting “Problem loading the page” after enabling HTTPS for Apache on Windows 7?SSL certificate proxy redirect to port mongrel rails app helpLive site with ssl enabled redirects to the staging site without sslConfiguring Apache reverse proxyVirtual hosts with port 80 & 443 not workingHow to Check if a SSL Certificate is successfully renewedNginx reverse proxy to many local servers + webserver duty



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Vague title I know but I wasn't sure how to summarise what I am trying to achieve.



Basically, I have an internet router port forwarding port ext port TCP 443 to the same port on an internal IP addressed linux reverse proxy running apache 2.2.



This reverse proxy is then forwarding connections on to the actual hosts of the web content.



Previously the server doing the reverse proxying was the internet gateway, and this worked as it had the public IP address that the CNAME resolved to for the name based vhosting.



However, since now this server has an internal IP address this is broken.



How can I achieve this or is there a better way if I want to use CNAMEs for name based vhosting.



What I had tried and failed at was to use rewrite to rewrite the address to the internal hostname but since that changes the address for the client of course they can't hit it.



<VirtualHost blah.somedomain.net:443>
ServerName blah.somedomain.net

RewriteEngine on
RewriteCond %HTTP_HOST ^blah.somedomain.net$
RewriteRule (.*) https://blah-proxy.somedomain.int
<Location />
Order deny,allow
Allow from all
</Location>
</VirtualHost>

<VirtualHost blah-proxy.somedomain.int:443>
ServerName blah-proxy.somedomain.int
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


Any suggestions?



Cheers



Andy




I tried the following instead, adding an IP address alias interface:



<VirtualHost 192.168.0.100:443>
ServerName blah.somedomain.net
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


I just don't get how a connection from an external source can get port forwarded to this webserver and the correct virtual host be identified and connections forwarded.



With the above it still changes the url to .int and fails.










share|improve this question



















  • 1





    If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

    – Michael Hampton
    Apr 18 at 5:52

















0















Vague title I know but I wasn't sure how to summarise what I am trying to achieve.



Basically, I have an internet router port forwarding port ext port TCP 443 to the same port on an internal IP addressed linux reverse proxy running apache 2.2.



This reverse proxy is then forwarding connections on to the actual hosts of the web content.



Previously the server doing the reverse proxying was the internet gateway, and this worked as it had the public IP address that the CNAME resolved to for the name based vhosting.



However, since now this server has an internal IP address this is broken.



How can I achieve this or is there a better way if I want to use CNAMEs for name based vhosting.



What I had tried and failed at was to use rewrite to rewrite the address to the internal hostname but since that changes the address for the client of course they can't hit it.



<VirtualHost blah.somedomain.net:443>
ServerName blah.somedomain.net

RewriteEngine on
RewriteCond %HTTP_HOST ^blah.somedomain.net$
RewriteRule (.*) https://blah-proxy.somedomain.int
<Location />
Order deny,allow
Allow from all
</Location>
</VirtualHost>

<VirtualHost blah-proxy.somedomain.int:443>
ServerName blah-proxy.somedomain.int
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


Any suggestions?



Cheers



Andy




I tried the following instead, adding an IP address alias interface:



<VirtualHost 192.168.0.100:443>
ServerName blah.somedomain.net
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


I just don't get how a connection from an external source can get port forwarded to this webserver and the correct virtual host be identified and connections forwarded.



With the above it still changes the url to .int and fails.










share|improve this question



















  • 1





    If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

    – Michael Hampton
    Apr 18 at 5:52













0












0








0








Vague title I know but I wasn't sure how to summarise what I am trying to achieve.



Basically, I have an internet router port forwarding port ext port TCP 443 to the same port on an internal IP addressed linux reverse proxy running apache 2.2.



This reverse proxy is then forwarding connections on to the actual hosts of the web content.



Previously the server doing the reverse proxying was the internet gateway, and this worked as it had the public IP address that the CNAME resolved to for the name based vhosting.



However, since now this server has an internal IP address this is broken.



How can I achieve this or is there a better way if I want to use CNAMEs for name based vhosting.



What I had tried and failed at was to use rewrite to rewrite the address to the internal hostname but since that changes the address for the client of course they can't hit it.



<VirtualHost blah.somedomain.net:443>
ServerName blah.somedomain.net

RewriteEngine on
RewriteCond %HTTP_HOST ^blah.somedomain.net$
RewriteRule (.*) https://blah-proxy.somedomain.int
<Location />
Order deny,allow
Allow from all
</Location>
</VirtualHost>

<VirtualHost blah-proxy.somedomain.int:443>
ServerName blah-proxy.somedomain.int
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


Any suggestions?



Cheers



Andy




I tried the following instead, adding an IP address alias interface:



<VirtualHost 192.168.0.100:443>
ServerName blah.somedomain.net
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


I just don't get how a connection from an external source can get port forwarded to this webserver and the correct virtual host be identified and connections forwarded.



With the above it still changes the url to .int and fails.










share|improve this question
















Vague title I know but I wasn't sure how to summarise what I am trying to achieve.



Basically, I have an internet router port forwarding port ext port TCP 443 to the same port on an internal IP addressed linux reverse proxy running apache 2.2.



This reverse proxy is then forwarding connections on to the actual hosts of the web content.



Previously the server doing the reverse proxying was the internet gateway, and this worked as it had the public IP address that the CNAME resolved to for the name based vhosting.



However, since now this server has an internal IP address this is broken.



How can I achieve this or is there a better way if I want to use CNAMEs for name based vhosting.



What I had tried and failed at was to use rewrite to rewrite the address to the internal hostname but since that changes the address for the client of course they can't hit it.



<VirtualHost blah.somedomain.net:443>
ServerName blah.somedomain.net

RewriteEngine on
RewriteCond %HTTP_HOST ^blah.somedomain.net$
RewriteRule (.*) https://blah-proxy.somedomain.int
<Location />
Order deny,allow
Allow from all
</Location>
</VirtualHost>

<VirtualHost blah-proxy.somedomain.int:443>
ServerName blah-proxy.somedomain.int
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


Any suggestions?



Cheers



Andy




I tried the following instead, adding an IP address alias interface:



<VirtualHost 192.168.0.100:443>
ServerName blah.somedomain.net
ProxyPass / http://blah.somedomain.int/
ProxyPassReverse / http://blah.somedomain.int/

<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


I just don't get how a connection from an external source can get port forwarded to this webserver and the correct virtual host be identified and connections forwarded.



With the above it still changes the url to .int and fails.







linux apache-2.2 reverse-proxy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 18 at 5:50









Michael Hampton

175k27321651




175k27321651










asked Apr 18 at 2:38









anfieldroadanfieldroad

83




83







  • 1





    If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

    – Michael Hampton
    Apr 18 at 5:52












  • 1





    If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

    – Michael Hampton
    Apr 18 at 5:52







1




1





If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

– Michael Hampton
Apr 18 at 5:52





If your URL was changed, that is your web application, not Apache. You have not configured a redirect in Apache. You also should not use domains which are not registered to you, such as subdomains of .int, which is a valid global top-level domain.

– Michael Hampton
Apr 18 at 5:52










3 Answers
3






active

oldest

votes


















2














Your virtual hosts never match because you used names in them, though this is documented as not recommended. Your current setup is one reason why.



Because you used a name, Apache must look up the name to find the IP address to listen on, for connections that match that virtual host. Since that machine no longer has a global IP address, the IP address from DNS will never match.



You should instead match on any address. There's occasionally a good reason to specify an IP address in <VirtualHost>, but there's virtually never a good reason to use a name. In this case there's no real reason to use either.



<VirtualHost *:443>





share|improve this answer























  • 0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

    – anfieldroad
    Apr 18 at 3:56











  • @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

    – Michael Hampton
    Apr 18 at 4:01












  • Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

    – anfieldroad
    Apr 18 at 10:15


















0














You have more than one issue here.



  1. If your web server is behind a router and port forwarding is in place, you have the following scenario. Requests from internet come to you public IP of your router's internet connection. Router recognizes packets for internal site based on port forwarding rules, and replaces destination IP in all these packets. That means that it forwards that traffic to your internal server with internal IP. For your server nothing else as the packet's destination IP is changed on the way through router. Router also takes care that responds that it gets from internal web server are properly recognized and sent back to original sender as if they were sent from router. It masquerades (hides) your internal servers from internet. Therefore you should use internal IP in VirtualHost directives.


  2. Name based virtual hosts for HTTPS (SSL) was spedified in 2003 and available since 2007. The problem is that name based virtual hosting establishes a connection and then it sends the name of the site in HTTP request. Based on that HTTP request's name, web server knows which virtual site is being addresses. In HTTPS, certificates have to be exchanged to authenticate the site, so user can be sure she/he has come to the right place. To request site with a name in HTTPS request is far to late, because at that time the correct certificates have to be exchanged already. Therefore, SNI extension has been introduced, which allows name base virtual hosting. Take a look here https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI and here http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslstrictsnivhostcheck. Since you have port forwarding, destination IPs are being replaced in order to come to your virtual host via router. That means that packets arriving to virtual host have internal destination IP, but the name of the site is not changed. So you should use internal IPs, and the correct (external) name of the web site for your virtual host configuration.


  3. You then have a reverse proxy to actual sites where the content is available. You have not specified if that content is in your internal network, or is it somewhere else. In fact, it does not really matter. You just need to make sure that the content is accessible from your reverse proxy with the addresses, which you specify in reverse proxy configuration. Try to setup internally accessible virtual hosts, where you can test your reverse proxies. You can do that by specifying names for internal IPs. Assign names for your web server's internal IP with hosts file (https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts) on your client and web server. You can then use these names for internal name based virtual hosting, where you can test proxy and name based virtual hosts.


My advice would be to setup one site first, to see that everything works with port forwarding, reverse proxying, etc. Then add other sites. I have almost identical configuration of web server behind a firewall in DMZ using SNI and used as a reverse proxy for another site in internal network, and it works perfectly.






share|improve this answer

























  • The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

    – anfieldroad
    Apr 18 at 9:53











  • Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

    – anfieldroad
    Apr 18 at 10:25











  • When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

    – nobody
    Apr 19 at 10:40











  • I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

    – nobody
    Apr 19 at 10:45


















0














After some tinkering and experimenting I have a working configuration:



<VirtualHost 192.168.20.250:443>
ServerName blah.somedomain.net
ProxyPass "/" "https://blah.somedomain.int/"
ProxyPassReverse "/" "https://blah.somedomain.int/"

# <Location />
# ProxyPassReverse /
# Order deny,allow
# Allow from all
# </Location>
Loglevel debug
ServerAdmin webmaster@somedomain.net
ErrorLog logs/blah.somedomain.net-error_log
CustomLog logs/blah.somedomain.net-access_log common
SSLProxyEngine on
SSLEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
</VirtualHost>


If this can be improved upon I am happy to hear suggestions but the main thing is it is functional right now :)



Thanks to all who responded.



Andy






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963590%2fname-based-virtual-hosting-on-non-routable-ips%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Your virtual hosts never match because you used names in them, though this is documented as not recommended. Your current setup is one reason why.



    Because you used a name, Apache must look up the name to find the IP address to listen on, for connections that match that virtual host. Since that machine no longer has a global IP address, the IP address from DNS will never match.



    You should instead match on any address. There's occasionally a good reason to specify an IP address in <VirtualHost>, but there's virtually never a good reason to use a name. In this case there's no real reason to use either.



    <VirtualHost *:443>





    share|improve this answer























    • 0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

      – anfieldroad
      Apr 18 at 3:56











    • @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

      – Michael Hampton
      Apr 18 at 4:01












    • Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

      – anfieldroad
      Apr 18 at 10:15















    2














    Your virtual hosts never match because you used names in them, though this is documented as not recommended. Your current setup is one reason why.



    Because you used a name, Apache must look up the name to find the IP address to listen on, for connections that match that virtual host. Since that machine no longer has a global IP address, the IP address from DNS will never match.



    You should instead match on any address. There's occasionally a good reason to specify an IP address in <VirtualHost>, but there's virtually never a good reason to use a name. In this case there's no real reason to use either.



    <VirtualHost *:443>





    share|improve this answer























    • 0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

      – anfieldroad
      Apr 18 at 3:56











    • @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

      – Michael Hampton
      Apr 18 at 4:01












    • Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

      – anfieldroad
      Apr 18 at 10:15













    2












    2








    2







    Your virtual hosts never match because you used names in them, though this is documented as not recommended. Your current setup is one reason why.



    Because you used a name, Apache must look up the name to find the IP address to listen on, for connections that match that virtual host. Since that machine no longer has a global IP address, the IP address from DNS will never match.



    You should instead match on any address. There's occasionally a good reason to specify an IP address in <VirtualHost>, but there's virtually never a good reason to use a name. In this case there's no real reason to use either.



    <VirtualHost *:443>





    share|improve this answer













    Your virtual hosts never match because you used names in them, though this is documented as not recommended. Your current setup is one reason why.



    Because you used a name, Apache must look up the name to find the IP address to listen on, for connections that match that virtual host. Since that machine no longer has a global IP address, the IP address from DNS will never match.



    You should instead match on any address. There's occasionally a good reason to specify an IP address in <VirtualHost>, but there's virtually never a good reason to use a name. In this case there's no real reason to use either.



    <VirtualHost *:443>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 18 at 2:55









    Michael HamptonMichael Hampton

    175k27321651




    175k27321651












    • 0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

      – anfieldroad
      Apr 18 at 3:56











    • @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

      – Michael Hampton
      Apr 18 at 4:01












    • Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

      – anfieldroad
      Apr 18 at 10:15

















    • 0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

      – anfieldroad
      Apr 18 at 3:56











    • @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

      – Michael Hampton
      Apr 18 at 4:01












    • Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

      – anfieldroad
      Apr 18 at 10:15
















    0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

    – anfieldroad
    Apr 18 at 3:56





    0 thanks for responding. I'm not sure how you could implement that solution without getting: [warn] default VirtualHost overlap on port 443, the first has precedence I am running more than one virtualhost. They can't all be *:443 I could use IP based virtual hosting but it will still be an internal IP address.

    – anfieldroad
    Apr 18 at 3:56













    @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

    – Michael Hampton
    Apr 18 at 4:01






    @anfieldroad Huh? Did you actually receive that message? All of your virtual hosts can be on port 443 for any IP address. What version of Apache did you install? I think you didn't actually try this. You should do so first.

    – Michael Hampton
    Apr 18 at 4:01














    Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

    – anfieldroad
    Apr 18 at 10:15





    Hi yes it was just a warning, all good on that front. The issue as commented on another answer is that it is changing the address to the .int internal non-routable address. I just want it to reverse proxy it.

    – anfieldroad
    Apr 18 at 10:15













    0














    You have more than one issue here.



    1. If your web server is behind a router and port forwarding is in place, you have the following scenario. Requests from internet come to you public IP of your router's internet connection. Router recognizes packets for internal site based on port forwarding rules, and replaces destination IP in all these packets. That means that it forwards that traffic to your internal server with internal IP. For your server nothing else as the packet's destination IP is changed on the way through router. Router also takes care that responds that it gets from internal web server are properly recognized and sent back to original sender as if they were sent from router. It masquerades (hides) your internal servers from internet. Therefore you should use internal IP in VirtualHost directives.


    2. Name based virtual hosts for HTTPS (SSL) was spedified in 2003 and available since 2007. The problem is that name based virtual hosting establishes a connection and then it sends the name of the site in HTTP request. Based on that HTTP request's name, web server knows which virtual site is being addresses. In HTTPS, certificates have to be exchanged to authenticate the site, so user can be sure she/he has come to the right place. To request site with a name in HTTPS request is far to late, because at that time the correct certificates have to be exchanged already. Therefore, SNI extension has been introduced, which allows name base virtual hosting. Take a look here https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI and here http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslstrictsnivhostcheck. Since you have port forwarding, destination IPs are being replaced in order to come to your virtual host via router. That means that packets arriving to virtual host have internal destination IP, but the name of the site is not changed. So you should use internal IPs, and the correct (external) name of the web site for your virtual host configuration.


    3. You then have a reverse proxy to actual sites where the content is available. You have not specified if that content is in your internal network, or is it somewhere else. In fact, it does not really matter. You just need to make sure that the content is accessible from your reverse proxy with the addresses, which you specify in reverse proxy configuration. Try to setup internally accessible virtual hosts, where you can test your reverse proxies. You can do that by specifying names for internal IPs. Assign names for your web server's internal IP with hosts file (https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts) on your client and web server. You can then use these names for internal name based virtual hosting, where you can test proxy and name based virtual hosts.


    My advice would be to setup one site first, to see that everything works with port forwarding, reverse proxying, etc. Then add other sites. I have almost identical configuration of web server behind a firewall in DMZ using SNI and used as a reverse proxy for another site in internal network, and it works perfectly.






    share|improve this answer

























    • The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

      – anfieldroad
      Apr 18 at 9:53











    • Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

      – anfieldroad
      Apr 18 at 10:25











    • When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

      – nobody
      Apr 19 at 10:40











    • I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

      – nobody
      Apr 19 at 10:45















    0














    You have more than one issue here.



    1. If your web server is behind a router and port forwarding is in place, you have the following scenario. Requests from internet come to you public IP of your router's internet connection. Router recognizes packets for internal site based on port forwarding rules, and replaces destination IP in all these packets. That means that it forwards that traffic to your internal server with internal IP. For your server nothing else as the packet's destination IP is changed on the way through router. Router also takes care that responds that it gets from internal web server are properly recognized and sent back to original sender as if they were sent from router. It masquerades (hides) your internal servers from internet. Therefore you should use internal IP in VirtualHost directives.


    2. Name based virtual hosts for HTTPS (SSL) was spedified in 2003 and available since 2007. The problem is that name based virtual hosting establishes a connection and then it sends the name of the site in HTTP request. Based on that HTTP request's name, web server knows which virtual site is being addresses. In HTTPS, certificates have to be exchanged to authenticate the site, so user can be sure she/he has come to the right place. To request site with a name in HTTPS request is far to late, because at that time the correct certificates have to be exchanged already. Therefore, SNI extension has been introduced, which allows name base virtual hosting. Take a look here https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI and here http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslstrictsnivhostcheck. Since you have port forwarding, destination IPs are being replaced in order to come to your virtual host via router. That means that packets arriving to virtual host have internal destination IP, but the name of the site is not changed. So you should use internal IPs, and the correct (external) name of the web site for your virtual host configuration.


    3. You then have a reverse proxy to actual sites where the content is available. You have not specified if that content is in your internal network, or is it somewhere else. In fact, it does not really matter. You just need to make sure that the content is accessible from your reverse proxy with the addresses, which you specify in reverse proxy configuration. Try to setup internally accessible virtual hosts, where you can test your reverse proxies. You can do that by specifying names for internal IPs. Assign names for your web server's internal IP with hosts file (https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts) on your client and web server. You can then use these names for internal name based virtual hosting, where you can test proxy and name based virtual hosts.


    My advice would be to setup one site first, to see that everything works with port forwarding, reverse proxying, etc. Then add other sites. I have almost identical configuration of web server behind a firewall in DMZ using SNI and used as a reverse proxy for another site in internal network, and it works perfectly.






    share|improve this answer

























    • The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

      – anfieldroad
      Apr 18 at 9:53











    • Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

      – anfieldroad
      Apr 18 at 10:25











    • When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

      – nobody
      Apr 19 at 10:40











    • I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

      – nobody
      Apr 19 at 10:45













    0












    0








    0







    You have more than one issue here.



    1. If your web server is behind a router and port forwarding is in place, you have the following scenario. Requests from internet come to you public IP of your router's internet connection. Router recognizes packets for internal site based on port forwarding rules, and replaces destination IP in all these packets. That means that it forwards that traffic to your internal server with internal IP. For your server nothing else as the packet's destination IP is changed on the way through router. Router also takes care that responds that it gets from internal web server are properly recognized and sent back to original sender as if they were sent from router. It masquerades (hides) your internal servers from internet. Therefore you should use internal IP in VirtualHost directives.


    2. Name based virtual hosts for HTTPS (SSL) was spedified in 2003 and available since 2007. The problem is that name based virtual hosting establishes a connection and then it sends the name of the site in HTTP request. Based on that HTTP request's name, web server knows which virtual site is being addresses. In HTTPS, certificates have to be exchanged to authenticate the site, so user can be sure she/he has come to the right place. To request site with a name in HTTPS request is far to late, because at that time the correct certificates have to be exchanged already. Therefore, SNI extension has been introduced, which allows name base virtual hosting. Take a look here https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI and here http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslstrictsnivhostcheck. Since you have port forwarding, destination IPs are being replaced in order to come to your virtual host via router. That means that packets arriving to virtual host have internal destination IP, but the name of the site is not changed. So you should use internal IPs, and the correct (external) name of the web site for your virtual host configuration.


    3. You then have a reverse proxy to actual sites where the content is available. You have not specified if that content is in your internal network, or is it somewhere else. In fact, it does not really matter. You just need to make sure that the content is accessible from your reverse proxy with the addresses, which you specify in reverse proxy configuration. Try to setup internally accessible virtual hosts, where you can test your reverse proxies. You can do that by specifying names for internal IPs. Assign names for your web server's internal IP with hosts file (https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts) on your client and web server. You can then use these names for internal name based virtual hosting, where you can test proxy and name based virtual hosts.


    My advice would be to setup one site first, to see that everything works with port forwarding, reverse proxying, etc. Then add other sites. I have almost identical configuration of web server behind a firewall in DMZ using SNI and used as a reverse proxy for another site in internal network, and it works perfectly.






    share|improve this answer















    You have more than one issue here.



    1. If your web server is behind a router and port forwarding is in place, you have the following scenario. Requests from internet come to you public IP of your router's internet connection. Router recognizes packets for internal site based on port forwarding rules, and replaces destination IP in all these packets. That means that it forwards that traffic to your internal server with internal IP. For your server nothing else as the packet's destination IP is changed on the way through router. Router also takes care that responds that it gets from internal web server are properly recognized and sent back to original sender as if they were sent from router. It masquerades (hides) your internal servers from internet. Therefore you should use internal IP in VirtualHost directives.


    2. Name based virtual hosts for HTTPS (SSL) was spedified in 2003 and available since 2007. The problem is that name based virtual hosting establishes a connection and then it sends the name of the site in HTTP request. Based on that HTTP request's name, web server knows which virtual site is being addresses. In HTTPS, certificates have to be exchanged to authenticate the site, so user can be sure she/he has come to the right place. To request site with a name in HTTPS request is far to late, because at that time the correct certificates have to be exchanged already. Therefore, SNI extension has been introduced, which allows name base virtual hosting. Take a look here https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI and here http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslstrictsnivhostcheck. Since you have port forwarding, destination IPs are being replaced in order to come to your virtual host via router. That means that packets arriving to virtual host have internal destination IP, but the name of the site is not changed. So you should use internal IPs, and the correct (external) name of the web site for your virtual host configuration.


    3. You then have a reverse proxy to actual sites where the content is available. You have not specified if that content is in your internal network, or is it somewhere else. In fact, it does not really matter. You just need to make sure that the content is accessible from your reverse proxy with the addresses, which you specify in reverse proxy configuration. Try to setup internally accessible virtual hosts, where you can test your reverse proxies. You can do that by specifying names for internal IPs. Assign names for your web server's internal IP with hosts file (https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts) on your client and web server. You can then use these names for internal name based virtual hosting, where you can test proxy and name based virtual hosts.


    My advice would be to setup one site first, to see that everything works with port forwarding, reverse proxying, etc. Then add other sites. I have almost identical configuration of web server behind a firewall in DMZ using SNI and used as a reverse proxy for another site in internal network, and it works perfectly.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 18 at 6:06

























    answered Apr 18 at 5:49









    nobodynobody

    1215




    1215












    • The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

      – anfieldroad
      Apr 18 at 9:53











    • Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

      – anfieldroad
      Apr 18 at 10:25











    • When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

      – nobody
      Apr 19 at 10:40











    • I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

      – nobody
      Apr 19 at 10:45

















    • The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

      – anfieldroad
      Apr 18 at 9:53











    • Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

      – anfieldroad
      Apr 18 at 10:25











    • When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

      – nobody
      Apr 19 at 10:40











    • I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

      – nobody
      Apr 19 at 10:45
















    The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

    – anfieldroad
    Apr 18 at 9:53





    The thing I don't understand is how the webserver determines what virtual host to use. Externally the cname would be used but once it hits the port forward that gets lost as destination is the IP of the webserver. I don't really see what a solution should look like, are there any examples you can point me to? All my attempts so far result in a failed connection because it redirects the broser to the .int internal address which is supposed to be a reverse proxy.

    – anfieldroad
    Apr 18 at 9:53













    Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

    – anfieldroad
    Apr 18 at 10:25





    Yes everything is on the internal network. Router port forwards to a linux server that is a firewall/gateway to my lab network. That server runs apache and does reverse proxying to the various web services in that lab.

    – anfieldroad
    Apr 18 at 10:25













    When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

    – nobody
    Apr 19 at 10:40





    When browser make a connection it also specifies the name of the site. In HTTP it adds another a line in HTTP header, which looks like this Host: blah.somedomain.net. In HTTPS it is a bit more complicated but still browser has to specify the hostname for apache to recognize the virtual host.

    – nobody
    Apr 19 at 10:40













    I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

    – nobody
    Apr 19 at 10:45





    I think you should use a virtualhost with internal IP and external hostname. Traffic to you apache comes via router, which replaces external IPs with internal ones. However the hostname remains the same. You should have everything in one virtualhost: internal IP, external hostname, and reverse proxy directives. You do not need rewrite rules, your site will be shown to external world as external site with external IP. Your router and apache will take care that content will be served from a computer hidden in your lab. Oh, I see now that you have done it already. Congratulations!

    – nobody
    Apr 19 at 10:45











    0














    After some tinkering and experimenting I have a working configuration:



    <VirtualHost 192.168.20.250:443>
    ServerName blah.somedomain.net
    ProxyPass "/" "https://blah.somedomain.int/"
    ProxyPassReverse "/" "https://blah.somedomain.int/"

    # <Location />
    # ProxyPassReverse /
    # Order deny,allow
    # Allow from all
    # </Location>
    Loglevel debug
    ServerAdmin webmaster@somedomain.net
    ErrorLog logs/blah.somedomain.net-error_log
    CustomLog logs/blah.somedomain.net-access_log common
    SSLProxyEngine on
    SSLEngine On
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
    </VirtualHost>


    If this can be improved upon I am happy to hear suggestions but the main thing is it is functional right now :)



    Thanks to all who responded.



    Andy






    share|improve this answer



























      0














      After some tinkering and experimenting I have a working configuration:



      <VirtualHost 192.168.20.250:443>
      ServerName blah.somedomain.net
      ProxyPass "/" "https://blah.somedomain.int/"
      ProxyPassReverse "/" "https://blah.somedomain.int/"

      # <Location />
      # ProxyPassReverse /
      # Order deny,allow
      # Allow from all
      # </Location>
      Loglevel debug
      ServerAdmin webmaster@somedomain.net
      ErrorLog logs/blah.somedomain.net-error_log
      CustomLog logs/blah.somedomain.net-access_log common
      SSLProxyEngine on
      SSLEngine On
      Include /etc/letsencrypt/options-ssl-apache.conf
      SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
      SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
      SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
      </VirtualHost>


      If this can be improved upon I am happy to hear suggestions but the main thing is it is functional right now :)



      Thanks to all who responded.



      Andy






      share|improve this answer

























        0












        0








        0







        After some tinkering and experimenting I have a working configuration:



        <VirtualHost 192.168.20.250:443>
        ServerName blah.somedomain.net
        ProxyPass "/" "https://blah.somedomain.int/"
        ProxyPassReverse "/" "https://blah.somedomain.int/"

        # <Location />
        # ProxyPassReverse /
        # Order deny,allow
        # Allow from all
        # </Location>
        Loglevel debug
        ServerAdmin webmaster@somedomain.net
        ErrorLog logs/blah.somedomain.net-error_log
        CustomLog logs/blah.somedomain.net-access_log common
        SSLProxyEngine on
        SSLEngine On
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
        </VirtualHost>


        If this can be improved upon I am happy to hear suggestions but the main thing is it is functional right now :)



        Thanks to all who responded.



        Andy






        share|improve this answer













        After some tinkering and experimenting I have a working configuration:



        <VirtualHost 192.168.20.250:443>
        ServerName blah.somedomain.net
        ProxyPass "/" "https://blah.somedomain.int/"
        ProxyPassReverse "/" "https://blah.somedomain.int/"

        # <Location />
        # ProxyPassReverse /
        # Order deny,allow
        # Allow from all
        # </Location>
        Loglevel debug
        ServerAdmin webmaster@somedomain.net
        ErrorLog logs/blah.somedomain.net-error_log
        CustomLog logs/blah.somedomain.net-access_log common
        SSLProxyEngine on
        SSLEngine On
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/blah.somedomain.net/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/blah.somedomain.net/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/blah.somedomain.net/chain.pem
        </VirtualHost>


        If this can be improved upon I am happy to hear suggestions but the main thing is it is functional right now :)



        Thanks to all who responded.



        Andy







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 18 at 11:13









        anfieldroadanfieldroad

        83




        83



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963590%2fname-based-virtual-hosting-on-non-routable-ips%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

            Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020