美文网首页
Nginx配置多域名二级域名

Nginx配置多域名二级域名

作者: 一沭丶 | 来源:发表于2016-11-28 21:32 被阅读318次
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

# user nginx;
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        server_name  www.ccc.com;
        root         /root/project/list;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
    server {
        listen       80;
        server_name  www.xxx.com aa.ccc.com;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
            root         /root/project/list/shunshungo;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }


# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }

}


然后敲命令 nginx -s reload

相关文章

  • 二级域名配置步骤

    转自二级域名配置步骤。 这篇文章主要介绍在配置二级域名时候的步骤,主要涉及到nginx、dns的配置,有相同需求的...

  • 宝塔面板,Nginx的配置文件nginx.conf的路径位置

    nginx.conf文件路径: 多域名Nginx配置文件: 主配置文件nginx.conf,会将多域名的配置引入

  • Nginx配置二级域名

    首先, 需要在域名服务商处配置二级域名, 如阿里万网 配置nginx我买的是digitalocean的服务器

  • Nginx配置多域名二级域名

    然后敲命令 nginx -s reload

  • nginx配置多域名(二级域名)

    前提条件:1)nginx已安装完毕;2)php安装完毕;NGINX配置详解(基础版)这里为什么说是基础版,因为你简...

  • nginx配置二级域名(多级域名)

    nginx配置二级域名(多级域名) 起因 之前在v2看到毒鸡汤,很是喜欢,想着也部署到我的博客上来,域名就用二级域...

  • 腾讯云配置

    腾讯云配置启动多个node Nginx 配置多域名不同端口 首先需要编辑/etc/nginx/nginx.conf...

  • 使用nginx配置二级域名

    最近想把三个项目配在一个服务器上,于是想使用nginx配置二级域名实现。 1.域名添加解析 我的是阿里云的域名,所...

  • 路由配置 二级域名

    基于thinkphp5.1二级域名 通过路由配置指向指定模块eg:主域名:www.aa.com二级域名:m.aa....

  • nginx详解

    基于域名的配置(核心配置如下) nginx的多server规范使用 nginx的主配置文件为/usr/local/...

网友评论

      本文标题:Nginx配置多域名二级域名

      本文链接:https://www.haomeiwen.com/subject/mwzopttx.html