I have an 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:
(the * in the urls is to tell stackexchange to stop bothering about them)server_name www.nicolòzanetti.com nicolòzanetti.com;
h*tps://www.nicolòzanetti.com -> Default virtual host but url unchanged
h*tps://nicolòzanetti.com -> Default virtual host but url unchanged
h*tp://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
h*tp://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;
h*tps://www.nicolòzanetti.com -> Works!
h*tps://nicolòzanetti.com -> Works!
h*tp://www.nicolòzanetti.com -> Default virtual host and url changed to that of default virtual host
h*tp://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.
Both Nginx in the http declaration and PHP have been set to use utf8, I can't tell the same for perl (I don't even know if I should or how).
I should use the nginx encode function? If yes where can I find some examples please? How else may I solve this?