How do I find the cause of an unwanted redirect by Nginx?Blank Page: wordpress on nginx+php-fpmnginx php5-fpm path_info urls and root locationNGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404nginx rewrite throw 404 with last and breaknginx PHP files downloading instead of executingPHP7.0-FPM and Nginx don't work using unix socketsCodeIgniter nginx rewrite rules for i8ln URL'sHow to configure nginx to serve one site from two different document root and using different php depending on URLlimit_req_zone for the whole PHP

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

LaTeX: Why are digits allowed in environments, but forbidden in commands?

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

Paid for article while in US on F-1 visa?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Why is Minecraft giving an OpenGL error?

How much of data wrangling is a data scientist's job?

How much RAM could one put in a typical 80386 setup?

"You are your self first supporter", a more proper way to say it

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Theorems that impeded progress

Intersection point of 2 lines defined by 2 points each

Does detail obscure or enhance action?

How old can references or sources in a thesis be?

Languages that we cannot (dis)prove to be Context-Free

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How does one intimidate enemies without having the capacity for violence?

Can you really stack all of this on an Opportunity Attack?

How to format long polynomial?

Book with a girl whose grandma is a phoenix, cover depicts the emerald/green-eyed blonde girl

Which country benefited the most from UN Security Council vetoes?

Why are electrically insulating heatsinks so rare? Is it just cost?

Today is the Center



How do I find the cause of an unwanted redirect by Nginx?


Blank Page: wordpress on nginx+php-fpmnginx php5-fpm path_info urls and root locationNGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404nginx rewrite throw 404 with last and breaknginx PHP files downloading instead of executingPHP7.0-FPM and Nginx don't work using unix socketsCodeIgniter nginx rewrite rules for i8ln URL'sHow to configure nginx to serve one site from two different document root and using different php depending on URLlimit_req_zone for the whole PHP






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm using nginx as my server. I have two domain names abc.com and xyz.com. Somehow I have configured abc.com to go to xyz.com but I cannot find where. I have a file under sites-enabled for each domain but the redirect is not there. I also checked nginx.conf and didn't see any redirects. Where can this redirect be coming from? Interesting thing is that when I remove abc.com server file from sites-enabled, I get the 404 error. The server file in sites-enabled looks something like:



server 
server_name www.abc.com default_server;
root /var/www/dev;
index index.php;

location /
try_files $uri $uri/ @handler;

location @handler
rewrite / /index.php;

location ^~ /html
try_files $uri $uri/;

location ^~ /phpmyadmin
alias /usr/share/phpmyadmin;
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/dbms_pass;
index index.php index.html index.htm;
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;



location ^~ /livehelp
try_files $uri $uri/ /livehelp/index.php?$args;
location ~ /livehelp/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;



location ^~ /livehelp/operator
try_files $uri $uri/ /livehelp/operator/index.php?$args;
location ~ /livehelp/operator/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;


# Denied locations require a "^~" to prevent regexes (such as the PHP handler below) from mat$
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location ^~ /app/ return 403;
location ^~ /includes/ return 403;
location ^~ /media/downloadable/ return 403;
location ^~ /pkginfo/ return 403;
location ^~ /report/config.xml return 403;
location ^~ /var/ return 403;
location ^~ /lib/ return 403;
location ^~ /dev/ return 403;
location ^~ /RELEASE_NOTES.txt return 403;
location ^~ /downloader/pearlib return 403;
location ^~ /downloader/template return 403;
location ^~ /downloader/Maged return 403;
location ~* ^/errors/.+.xml return 403;
location ^~ /rfqnet/ return 403;
location ~ .php/
rewrite ^(.*.php)/ $1 last;

location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
set $MAGE_ROOT /var/www/dev;
set $MAGE_MODE developer;


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.abc.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server
if ($host = www.abc.com)
return 301 https://$host$request_uri;
# managed by Certbot
server_name www.abc.com;



Where can i check to find the cause of this unwanted redirect?










share|improve this question
























  • It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

    – Michael Hampton
    Apr 3 at 1:42











  • @MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

    – Jorjani
    Apr 3 at 1:48











  • Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

    – Jorjani
    Apr 3 at 1:54

















0















I'm using nginx as my server. I have two domain names abc.com and xyz.com. Somehow I have configured abc.com to go to xyz.com but I cannot find where. I have a file under sites-enabled for each domain but the redirect is not there. I also checked nginx.conf and didn't see any redirects. Where can this redirect be coming from? Interesting thing is that when I remove abc.com server file from sites-enabled, I get the 404 error. The server file in sites-enabled looks something like:



server 
server_name www.abc.com default_server;
root /var/www/dev;
index index.php;

location /
try_files $uri $uri/ @handler;

location @handler
rewrite / /index.php;

location ^~ /html
try_files $uri $uri/;

location ^~ /phpmyadmin
alias /usr/share/phpmyadmin;
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/dbms_pass;
index index.php index.html index.htm;
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;



location ^~ /livehelp
try_files $uri $uri/ /livehelp/index.php?$args;
location ~ /livehelp/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;



location ^~ /livehelp/operator
try_files $uri $uri/ /livehelp/operator/index.php?$args;
location ~ /livehelp/operator/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;


# Denied locations require a "^~" to prevent regexes (such as the PHP handler below) from mat$
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location ^~ /app/ return 403;
location ^~ /includes/ return 403;
location ^~ /media/downloadable/ return 403;
location ^~ /pkginfo/ return 403;
location ^~ /report/config.xml return 403;
location ^~ /var/ return 403;
location ^~ /lib/ return 403;
location ^~ /dev/ return 403;
location ^~ /RELEASE_NOTES.txt return 403;
location ^~ /downloader/pearlib return 403;
location ^~ /downloader/template return 403;
location ^~ /downloader/Maged return 403;
location ~* ^/errors/.+.xml return 403;
location ^~ /rfqnet/ return 403;
location ~ .php/
rewrite ^(.*.php)/ $1 last;

location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
set $MAGE_ROOT /var/www/dev;
set $MAGE_MODE developer;


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.abc.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server
if ($host = www.abc.com)
return 301 https://$host$request_uri;
# managed by Certbot
server_name www.abc.com;



Where can i check to find the cause of this unwanted redirect?










share|improve this question
























  • It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

    – Michael Hampton
    Apr 3 at 1:42











  • @MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

    – Jorjani
    Apr 3 at 1:48











  • Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

    – Jorjani
    Apr 3 at 1:54













0












0








0








I'm using nginx as my server. I have two domain names abc.com and xyz.com. Somehow I have configured abc.com to go to xyz.com but I cannot find where. I have a file under sites-enabled for each domain but the redirect is not there. I also checked nginx.conf and didn't see any redirects. Where can this redirect be coming from? Interesting thing is that when I remove abc.com server file from sites-enabled, I get the 404 error. The server file in sites-enabled looks something like:



server 
server_name www.abc.com default_server;
root /var/www/dev;
index index.php;

location /
try_files $uri $uri/ @handler;

location @handler
rewrite / /index.php;

location ^~ /html
try_files $uri $uri/;

location ^~ /phpmyadmin
alias /usr/share/phpmyadmin;
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/dbms_pass;
index index.php index.html index.htm;
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;



location ^~ /livehelp
try_files $uri $uri/ /livehelp/index.php?$args;
location ~ /livehelp/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;



location ^~ /livehelp/operator
try_files $uri $uri/ /livehelp/operator/index.php?$args;
location ~ /livehelp/operator/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;


# Denied locations require a "^~" to prevent regexes (such as the PHP handler below) from mat$
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location ^~ /app/ return 403;
location ^~ /includes/ return 403;
location ^~ /media/downloadable/ return 403;
location ^~ /pkginfo/ return 403;
location ^~ /report/config.xml return 403;
location ^~ /var/ return 403;
location ^~ /lib/ return 403;
location ^~ /dev/ return 403;
location ^~ /RELEASE_NOTES.txt return 403;
location ^~ /downloader/pearlib return 403;
location ^~ /downloader/template return 403;
location ^~ /downloader/Maged return 403;
location ~* ^/errors/.+.xml return 403;
location ^~ /rfqnet/ return 403;
location ~ .php/
rewrite ^(.*.php)/ $1 last;

location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
set $MAGE_ROOT /var/www/dev;
set $MAGE_MODE developer;


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.abc.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server
if ($host = www.abc.com)
return 301 https://$host$request_uri;
# managed by Certbot
server_name www.abc.com;



Where can i check to find the cause of this unwanted redirect?










share|improve this question
















I'm using nginx as my server. I have two domain names abc.com and xyz.com. Somehow I have configured abc.com to go to xyz.com but I cannot find where. I have a file under sites-enabled for each domain but the redirect is not there. I also checked nginx.conf and didn't see any redirects. Where can this redirect be coming from? Interesting thing is that when I remove abc.com server file from sites-enabled, I get the 404 error. The server file in sites-enabled looks something like:



server 
server_name www.abc.com default_server;
root /var/www/dev;
index index.php;

location /
try_files $uri $uri/ @handler;

location @handler
rewrite / /index.php;

location ^~ /html
try_files $uri $uri/;

location ^~ /phpmyadmin
alias /usr/share/phpmyadmin;
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/dbms_pass;
index index.php index.html index.htm;
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;



location ^~ /livehelp
try_files $uri $uri/ /livehelp/index.php?$args;
location ~ /livehelp/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;



location ^~ /livehelp/operator
try_files $uri $uri/ /livehelp/operator/index.php?$args;
location ~ /livehelp/operator/.*.php$
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;


# Denied locations require a "^~" to prevent regexes (such as the PHP handler below) from mat$
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location ^~ /app/ return 403;
location ^~ /includes/ return 403;
location ^~ /media/downloadable/ return 403;
location ^~ /pkginfo/ return 403;
location ^~ /report/config.xml return 403;
location ^~ /var/ return 403;
location ^~ /lib/ return 403;
location ^~ /dev/ return 403;
location ^~ /RELEASE_NOTES.txt return 403;
location ^~ /downloader/pearlib return 403;
location ^~ /downloader/template return 403;
location ^~ /downloader/Maged return 403;
location ~* ^/errors/.+.xml return 403;
location ^~ /rfqnet/ return 403;
location ~ .php/
rewrite ^(.*.php)/ $1 last;

location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
set $MAGE_ROOT /var/www/dev;
set $MAGE_MODE developer;


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.abc.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server
if ($host = www.abc.com)
return 301 https://$host$request_uri;
# managed by Certbot
server_name www.abc.com;



Where can i check to find the cause of this unwanted redirect?







nginx domain-name-system domain redirect http






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 3 at 1:33







Jorjani

















asked Apr 3 at 1:13









JorjaniJorjani

1087




1087












  • It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

    – Michael Hampton
    Apr 3 at 1:42











  • @MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

    – Jorjani
    Apr 3 at 1:48











  • Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

    – Jorjani
    Apr 3 at 1:54

















  • It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

    – Michael Hampton
    Apr 3 at 1:42











  • @MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

    – Jorjani
    Apr 3 at 1:48











  • Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

    – Jorjani
    Apr 3 at 1:54
















It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

– Michael Hampton
Apr 3 at 1:42





It's a Magento site? Did Magento send the redirect? I don't see anything in this nginx configuration that would do it.

– Michael Hampton
Apr 3 at 1:42













@MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

– Jorjani
Apr 3 at 1:48





@MichaelHampton It is a Magento site but I don't think it's coming from Magento. Is there anywhere else on Nginx that I could check? Maybe somewhere where there's a default or a fallback url configured?

– Jorjani
Apr 3 at 1:48













Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

– Jorjani
Apr 3 at 1:54





Actually seems like it was a Magento setting. I updated the home URL on Magento config and now they both forward to the new domain. Thanks

– Jorjani
Apr 3 at 1:54










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961218%2fhow-do-i-find-the-cause-of-an-unwanted-redirect-by-nginx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961218%2fhow-do-i-find-the-cause-of-an-unwanted-redirect-by-nginx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company