Recently I installed VESTACP and nginx, added domain name and everything is fine, I can access my website with domain but also when I type an IP address from server (http://11.11.11.11) I can access my website so is there any solution to avoid showing my ip address ?
Thank you guys
This is my nginx conf file:
listen 11.11.3.171:80;
server_name example.com www.example.com;
error_log /var/log/apache2/domains/example.com.error.log error;
location / {
proxy_pass http://11.11.3.171:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/example.com/public_html;
access_log /var/log/apache2/domains/example.com.log combined;
access_log /var/log/apache2/domains/example.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/example.com/document_errors/;
}
location @fallback {
proxy_pass http://11.11.3.171:8080;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/admin/conf/web/nginx.example.com.conf*;
}
Apache conf file:
<VirtualHost 11.11.3.171:8080>
ServerName example.com
ServerAlias www.example.com
ServerAdmin info@example.com
DocumentRoot /home/admin/web/example.com/public_html
ScriptAlias /cgi-bin/ /home/admin/web/example.com/cgi-bin/
Alias /vstats/ /home/admin/web/example.com/stats/
Alias /error/ /home/admin/web/example.com/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/example.com.bytes bytes
CustomLog /var/log/apache2/domains/example.com.log combined
ErrorLog /var/log/apache2/domains/example.com.error.log
<Directory /home/admin/web/example.com/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/example.com/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/example.com/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/apache2.example.com.conf*
</VirtualHost>