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

How avoid redirect to login web page

$
0
0
Hi.
Im using nginx as a proxy reverse.
I want that when somebody goes to:

buy.mydomain.com

nginx redirect it to this:

ttp://buy.mydomain.lan/buy/aplicacion.php?ah=st5c45d459b499c0.52378515&ai=buy||110000003;

And this is working fine!
But, if i put this

buy.mydomain.com/sdfa/ (or whatever)

nginx redirect to the web login of my server... (and i dont want that).

What i could do tho fix this??
Thanks to all and thanks for your time.

ps.:i dont speak english.


------------------------------------------------------------------------------------------------------
This is my config.

server {
listen 80;

# subdominio exclusivo para acceso externo
server_name buy.mydomain.com;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 60s;

# definimos un codigo de error ficticio para redirigir
error_page 418 = @directo;

location / {
# si es POST, debe ir sin controller ni query-string
if ($request_method = POST)
{
return 418;
}

expires -1;
# servidor interno donde corre buy
proxy_pass http://buy.mydomain.lan/buy/aplicacion.php?ah=st5c45d459b499c0.52378515&ai=buy||110000003;
#proxy_pass http://buy.mydomain.lan/buy/aplicacion.php?ai=buy||101000212;
proxy_redirect http://buy.mydomain.lan:80/ /;

}

# assets de buy/
location ~ /(skins|img|css|temp|js)/ {

return 418;
}

# acceso directo sin controller
location @directo {
expires -1;
# servidor interno donde corre buy
proxy_pass http://buy.mydomain.lan:80;
}

}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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