lnmp secondary domain configuration related

Ali cloud that domain name resolution that I have misread choose China Unicom parse parse out life and death in a remote telecommunication network

 

 

 So the above configuration on the right .... Select the default. Instantaneously parse it out ....

 

Out of nginx configuration not familiar with a little bit of science out later. Www also without normal access to the specified directory. The results can not find the second-level domain directory ... and arrested two domain names accessed through the capture of 80-port package

No information local ip, the two should be thought of a problem domain analysis

Capture command

tcpdump tcp port 80 -n -X -s 0

in conclusion

nginx default one nginx.conf

vi /usr/local/nginx/conf/nginx.conf this configuration file server_name localhost I think it is a fixed ip access way is to specify the root access to the directory to which to take

 

server
    {
        listen 80 default_server reuseport;
        #listen [::]:80 default_server ipv6only=on;
        server_name localhost;
        index index.html index.htm index.php;
        root  /home/wwwroot/wq.jxxx.cn;

        #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;

 如果此处 server_name localhost;   localhost 改成网站域名会提示 重复配置的警告 

这个配置文件末尾include vhost/*.conf;  代表 nginx 还要加载 虚拟主机目录里边的配置文件 

所以在此 www  二级域名 一级域名 server_name www.xxx.com xxx.com

我是设置到一起的  ,一般来说访问网站就是如此,. 这两个域名 指定同一个root 目录 即可

而bbs之类的二级域名单独设置一个

添加bbs虚拟主机命令

lnmp vhost add 这个方便不用自己一个一个添加配置了

修改代码目录权限 

自己玩的用chmod 777 即可

添加完之后 重启nginx  或者reload

lnmp restart

service nginx reload  restart  方法多种

就此测试了好几个小时的问题解决

 

Guess you like

Origin www.cnblogs.com/zuochanzi/p/11291985.html
Recommended