Nginx doesn't redirect www no m in Safari, iPhone, iPad

ramsoft75 nginx-forum at
Mon Jul 6 08:52:51 UTC 2015

Good day

There was a problem in testing in the terminal with the character "!", it
should be with "\" after, like this :

$ curl -A iPad -i\!/pt/--item-view/en/3190/Wok-Vintage

And the result was :

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 06 Jul 2015 08:50:10 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive

<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>

And in this case i changed the nginx configuration to :

if ($http_user_agent ~* '(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows
Phone)') {
           rewrite ^/$$1 permanent;

Posted at Nginx Forum:,260033,260071#msg-260071

More information about the nginx mailing list