Ngnix怎么在一个Server里同时使用http和https


我现在的nginx配置是

server {
  listen 80;
  ...
}

server {
  listen 443;
  ssl on;
  ...
}

但是这两个Server里的其他配置都是一模一样的,看的我恶心死了。。。有没有什么办法,让同一个Server监听80和443,然后同时使用http和https的?

ssl nginx https

聪明的傻哔 11 years, 1 month ago
listen              80;
listen              443 ssl;
jzjgxsh answered 11 years, 1 month ago

Your Answer