nginx `listen` configuration generated by Mozilla SSL Configuration Generator -
i use mozilla ssl configuration generator(https://mozilla.github.io/server-side-tls/ssl-config-generator/) generate configuration.
my selections nginx
, modern
,the configuration has piece of code this:
server { listen 80; listen [::]:80; return 301 https://$host$request_uri; }
questions:
1、there 2 listen
s,what difference between them?
2、do not need add server_name
in server
block?
1. there 2 listens, difference between them?
one listen ipv4 on port 80 , other ipv6 on port 80. need second 1 when want use ipv6
2. not need add server_name in server block
yes should define server_name
names website should reached on. if want allow www
or non-www
should change below
return 301 https://$host$request_uri;
to
return 301 https://example.com$request_uri;
Comments
Post a Comment