<div dir="ltr"><div><div><div><div>Thanks Steve and Alt for the hint. you point out the correct problem. there are two settings in wp-config.php which i change something like this and it worked. <br><br>from this<br><br>define('WP_HOME','<a href="http://www.xxx.com">http://www.xxx.com</a>');<br>define('WP_SITEURL','<a href="http://www.xxx.com">http://www.xxx.com</a>');<br><br></div>to this <br><br>define('WP_HOME','<a href="http://xxx.com">http://xxx.com</a>');<br>define('WP_SITEURL','<a href="http://xxx.com">http://xxx.com</a>');<br><br><br></div>now things are working as expected.<br><br></div>Thanks Alot :)<br><br></div>MYK<br><div><div><div><div><div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 12, 2016 at 8:07 PM, Steve Wilson <span dir="ltr"><<a href="mailto:lists-nginx@swsystem.co.uk" target="_blank">lists-nginx@swsystem.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>It sounds to me like wordpress believes that www is required and nginx doesn't want it.</p>
<p>I'd try commenting out the redirect server{} block and add the server_name to the <a href="http://xxx.com" target="_blank">xxx.com</a> one and see what you end up with in your browser, then have a look through the wordpress settings to see what it's wanting in the address bar.</p>
<p>For my wordpress there seems to be 2 options under Settings/General, "Wordpress Address (URL)" and "Site Address (URL)".</p><div><div class="h5">
<p>On 12/04/2016 15:32, Muhammad Yousuf Khan wrote:</p>
</div></div><blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>Dear All,<br><br></div>
I am very new to nginx and trying to learn it from very basic. i have a website and i am willing to remove the "www" before my actual domain name. the solution so far i have find out on google is very simple. <br><br></div>
so when ever any of the visitor visits my website by using <a href="http://www.xxx.com" target="_blank">www.xxx.com</a> he should be redirected to <a href="http://xxx.com" target="_blank">xxx.com</a>. fortunately everything is working as expected i can load php files and html file correctly, however when i try to load my actual website my browser shows error "redirection loop created"</div>
<br>here is the config code of my website.<br>
<div><br>server {<br>server_name <a href="http://www.xxx.com" target="_blank">www.xxx.com</a>;<br>return 301 $scheme://<a href="http://xxx.com" target="_blank">xxx.com</a>$request_uri;<br>}<br>
<div><br>server {<br>server_name <a href="http://xxx.com" target="_blank">xxx.com</a>;<br>root /var/www/html/xxx/public_html;<br>index index.php info.php;<br>access_log /var/log/nginx/<a href="http://xxx.com/access.log" target="_blank">xxx.com/access.log</a>;<br>error_log /var/log/nginx/<a href="http://xxx.com/error.log" target="_blank">xxx.com/error.log</a>;<br><br>location / {<br>try_files $uri $uri/ /index.php?q=$request_uri;<br>}<br><br>rewrite /wp-admin$ $scheme://$host$uri/ permanent;<br><br><br>location ~ \.php$ {<br>include fastcgi_params;<br>fastcgi_split_path_info ^(.+\.php)(/.+)$;<br>#fastcgi_pass unix:/var/run/php5-fpm.sock;<br>fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>fastcgi_index index.php;<br>fastcgi_param SCRIPT_FILENAME $request_filename;<br>}<br><br>location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|woff|woff2)$ {<br>add_header Access-Control-Allow-Origin <a href="http://xxx.com" target="_blank">xxx.com</a>;<br><br>}<br><br>}<br><br><br><br></div>
<div>I can access php files properly like info.php. to check whether php is working or not. however the problem part is wordpress.<br><br></div>
<div>when i try to load my wordpress site chrome shows an error saying reduction loop occur. <br><br></div>
<div>Any friendly advice will be highly appreciated.<br><br></div>
<div>Thanks,</div>
<div>Yousuf</div>
</div>
</div>
<br>
</div></div><span class=""><div style="margin:0;padding:0;font-family:monospace">_______________________________________________<br> nginx mailing list<br> <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br> <a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></div>
</span></blockquote>
<p><br></p>
</div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>