php - nginx配置多个站点的问题?

查看:103
本文介绍了php - nginx配置多个站点的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

我用nginx配置两个站点,一个站点要配置成https访问,一个是http来访问?

server {

    listen       443;
    server_name  www.gzjjhd.com;
    
    
    ssl on;
    ssl_certificate E:/webserver/nginx/sslkey/wosign.com.crt;
    ssl_certificate_key E:/webserver/nginx/sslkey/wosign.com.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
    ssl_prefer_server_ciphers on;


    location / {
        root   E:/www/jsd;
        index  index.php index.html index.htm;
    }

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

    location ~ \.php$ {
        root           E:/www/jsd;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

server {
    listen       80;
    server_name app.gzjjhd.com;

    location / {
        root   E:/www/HDWeb;
        index  index.php index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    
    include E:/www/HDWeb/rewrite.conf;
    
    location ~ \.php$ {
        root           E:/www/HDWeb;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

我这样配置完,app.gzjjhd.com 也变成 https://appgzjjhd.com 来访问。但是我不想要这样。我要http://app.gzjjhd.com 请教各位大神如何修改!

解决方案

分别用两个站点配置文件

这篇关于php - nginx配置多个站点的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆