Welcome! Log In Create A New Profile

Advanced

Re: How to get nginx to redirect to another path only if the root path is requested?

January 27, 2018 09:36PM
I have other subfolders in my location paths so for instance other than just / after my host, I also have /lang/english/grammar, and /lang/spanish/gramática

But I figured it out:

location = / {
resolver 127.0.0.1 valid=300s;
proxy_pass http://192.168.1.200:8080/;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
rewrite /(.*) /$1 break;
access_log ./logs/root_access.log;
error_log ./logs/root_error.log;
}

The = / that you suggested fixed it right up, thanks!
Subject Author Posted

How to get nginx to redirect to another path only if the root path is requested?

leeand00 January 26, 2018 02:24PM

Re: How to get nginx to redirect to another path only if the root path is requested?

Francis Daly January 27, 2018 08:28AM

Re: How to get nginx to redirect to another path only if the root path is requested?

leeand00 January 27, 2018 09:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 311
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready