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

ramsoft75 nginx-forum at
Tue Jul 7 09:28:56 UTC 2015

Hi there all and thank's for the help

Dear oscaretu, the curl was tested with " doesn't help, because ! is a
special character it needs a escaope after "\", so the correct curl command
for the terminal is :

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

Dear Francis Daly

For the initial configuration :

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

For the example above the output in terminal is :

HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Tue, 07 Jul 2015 09:19:47 GMT
Content-Type: text/html
Content-Length: 154
Connection: keep-alive

<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>

It's the same if i changed to :

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

The problem is not from Nginx but from Safari witch doesn't send the url
after #, the Safari removes the fragment.

There are some documentation about this in :

The question know how to handle this # problem with Safari.

Thank's for the help

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

More information about the nginx mailing list