I have a URL with special carachters (nicolòzanetti.com), and I'm having problem telling nginx how to handle it to the correct site.
With a basic configuration:
server_name www.nicolòzanetti.com nicolòzanetti.com;
https://www.nicolòzanetti.com -> Default virtual host but url unchanged
https://nicolòzanetti.com -> Default virtual host but url unchanged
http://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
http://nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
So i tried with PunyCode:
server_name www.xn--nicolzanetti-rhb.com xn--nicolzanetti-rhb.com www.nicolòzanetti.com nicolòzanetti.com;
https://www.nicolòzanetti.com -> Works!
https://nicolòzanetti.com -> Works!
http://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
http://nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
I even tried to use regex with ~^www\.nicolòzanetti.com$ and ~^www\.nicol.zanetti\.com$, but it failed again.
I should use the encode function? If yes where can I find some examples please?
With a basic configuration:
server_name www.nicolòzanetti.com nicolòzanetti.com;
https://www.nicolòzanetti.com -> Default virtual host but url unchanged
https://nicolòzanetti.com -> Default virtual host but url unchanged
http://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
http://nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
So i tried with PunyCode:
server_name www.xn--nicolzanetti-rhb.com xn--nicolzanetti-rhb.com www.nicolòzanetti.com nicolòzanetti.com;
https://www.nicolòzanetti.com -> Works!
https://nicolòzanetti.com -> Works!
http://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
http://nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
I even tried to use regex with ~^www\.nicolòzanetti.com$ and ~^www\.nicol.zanetti\.com$, but it failed again.
I should use the encode function? If yes where can I find some examples please?