RT 由于要https 加了证书 nginx配置文件如下 请问我应该怎么配置 二级域名
例如:我本身是www.abc.com 我现在要配 bbs.abc.com 配置文件该怎么实现? server {
listen 443;
server_name gdchaben.cn;
ssl on;
root /var/www/;
index index.html index.htm;
ssl_certificate cert/212592012570254.pem;
ssl_certificate_key cert/212592012570254.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /var/www/app;
index index.php index.html index.htm; if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php$ {
root /var/www/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/app$fastcgi_script_name;
include fastcgi_params;
} }
例如:我本身是www.abc.com 我现在要配 bbs.abc.com 配置文件该怎么实现? server {
listen 443;
server_name gdchaben.cn;
ssl on;
root /var/www/;
index index.html index.htm;
ssl_certificate cert/212592012570254.pem;
ssl_certificate_key cert/212592012570254.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /var/www/app;
index index.php index.html index.htm; if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php$ {
root /var/www/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/app$fastcgi_script_name;
include fastcgi_params;
} }
2、添加一份nginx 的*.conf 文件,修改bbs的server_name 和根目录 root
3、重启nginx