I'm using ubuntu x64 server with nginx as webserver.
In my company, we configured intranet (local) dns server so that, when you enter domain1.com, it goes directly into defined LAN ip adress.
We need global access for domain2.com, which located in same server. When we open global access for domain2.com, occurred following problem:
As you know, anyone can detect ip adress of domain2.com (our server).
The problem is, when you access directly using server's global ip adress, server opens automatically domain1.com which must be restricted for global access. Here is nginx config of domain1.com:
server
{
set $host_path "/var/www/domain1";
server_name domain1.com;
root $host_path;
set $yii_bootstrap "index.php";
client_max_body_size 2000M;
client_body_buffer_size 1024k;
listen 80;
charset utf-8;
index index.php index.html;
access_log /var/access_log;
error_log /var/error_log;
location ~ /(protected|framework|nbproject) {
deny all;
access_log off;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#let yii catch the calls to unexising PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
How to make domain1.com only for LAN (restrict global access)?