Plesk goes against one of the pitfalls and does what nginx says is wrong:
For setting the domain option: none, www, or non-www, plesk is doing this:
but it should be like this (use 2 server directives):
and besides, nginx doesn't like (IF) statements...
https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
i happened to notice this today
For setting the domain option: none, www, or non-www, plesk is doing this:
Code:
if ($host ~* ^domain\.com$) {
rewrite ^(.*)$ http://www.domain.com$1 permanent;
}
but it should be like this (use 2 server directives):
Code:
server {
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
server_name example.com;
# [...]
}
and besides, nginx doesn't like (IF) statements...
https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
i happened to notice this today