这里的配置域名都被改成了 123 321 这样的 正常使用真实的域名地址 ok
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
}
基础的就不介绍了
#-----------------------------璇.汉瀹..-------------------------------
server {
listen 80;
server_name www.123.com;
rewrite ^(.*)$ https://www.123.com;
}
server {
listen 443;
server_name www.123.com;
ssl on;
ssl_certificate /home/nginx/ssl/srdz/1_www.123.com_bundle.crt;
ssl_certificate_key /home/nginx/ssl/srdz/2_www.123.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/nginx/html/webapp;
index /srdz/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#----------------------------涓.储浼..--------------------------------
server {
listen 80;
server_name www.321.com;
rewrite ^(.*)$ https://321.com;
}
server {
listen 443;
server_name www.321.com;
ssl on;
ssl_certificate /home/nginx/ssl/zcqh/1_www.321.com_bundle.crt;
ssl_certificate_key /home/nginx/ssl/zcqh/2_www.321.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/nginx/html/webapp;
index /zcgsweb/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name www.333.net.cn;
location / {
root /home/nginx/html/webapp;
index /tenxun/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name www.123.com;
rewrite ^(.*)$ https://www.123.com;
}
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
#-----------------------------璇.汉瀹..-------------------------------
server {
listen 80;
server_name www.123.com;
rewrite ^(.*)$ https://www.123.com;
}
server {
listen 443;
server_name www.123.com;
ssl on;
ssl_certificate /home/nginx/ssl/srdz/1_www.123.com_bundle.crt;
ssl_certificate_key /home/nginx/ssl/srdz/2_www.123.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/nginx/html/webapp;
index /srdz/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#----------------------------涓.储浼..--------------------------------
server {
listen 80;
server_name www.321.com;
rewrite ^(.*)$ https://321.com;
}
server {
listen 443;
server_name www.321.com;
ssl on;
ssl_certificate /home/nginx/ssl/zcqh/1_www.321.com_bundle.crt;
ssl_certificate_key /home/nginx/ssl/zcqh/2_www.321.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/nginx/html/webapp;
index /zcgsweb/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#------------------------------------------------------------
#----------------------------涓.储浼..--------------------------------
server {
listen 80;
server_name www.333.net.cn;
location / {
root /home/nginx/html/webapp;
index /tenxun/index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#------------------------------------------------------------
#server {
# listen 9999;
# server_name localhost;
#
# location / {
# root /home/nginx/html/webapp/s001;
# index /index.html;
# }
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }
#}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
ok 持续更新