Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to have two virtual host configurations for the same server - one with internal ip address and one with domain name(the domain name points to the same server with the internal ip address)? Something like

Example for a server A the domain name is a.com, internal IP is xxx.xxx.xxx.xxx and external ip is yyy.yyy.yyy.yyy. The document root is also the same for them /var/www/html

 <VirtualHost xxx.xxx.xxx.xxx:80>
 .......
 </VirtualHost>


  <VirtualHost a.com:80>
  .......
  </VirtualHost>

Note that the internal IP address and the domain name belong to the same server or same server instance.

I am asking this to restrict some URLs for external users, redirect to https all external access and allow everything for internal users(without https).

Also they are for the same application...

share|improve this question
add comment

1 Answer 1

Is it possible to have two virtual host configurations for the same server - one with internal ip address and one with domain name?

Yes it is possible.

I would recommend you read through the Vhost Documentation

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.