军哥,如何既能用ip访问网站,也能用域名访问网站呢
当时用lnmp安装包安装的时候,只绑定了一个二级域名,现在用域名能正常访问,但是用ip访问就显示lnmp一键安装包安装成功界面,如何既能用ip访问网站,也能用域名访问呢?还是小白,望军哥详解,谢谢!
nignx.confserver
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root/home/wwwroot/default;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/access.log;
}
还有就是phpadmin的问题
就是如何把phpadmin整个移动到根目录呢 直接在目录目录上建站,然后nginx.conf中改域名就同时ip和域名都是一个了
页:
[1]