Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

URL special characters, punycode and http

$
0
0
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?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>