nginx keeps redirecting to welcome page

2

I am using the following config:

server {
    listen       80;
    server_name  192.168.1.10;
location /shutter {
    proxy_pass http://192.168.1.10:8989;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

The application I am using is called shutter lite: http://www.den4b.com/?x=products&product=shutter

When I enter

http://192.168.1.10:8989

it takes me to 'login' screen and then the web interface of the application, so that works.

But, When I enter

http://192.168.1.10/shutter

I get to the 'login' screen for the application. As soon as I login, it takes me to the nginx welcome screen instead of the web interface of the application.

The above config works for other applications, it is only the shutter application that gives me this problem.

I am not sure where I am going wrong..

Any suggestions?

JBloggs43

Posted 2015-10-24T15:07:28.267

Reputation: 21

It looks like it could be a typo, your {} blocks don't seem to match up, ie you aren't closing your server block. – jmreicha – 2015-10-25T04:42:27.890

The server block gets closed after the 'error' section further down the conf file. – JBloggs43 – 2015-10-25T08:15:46.573

You should probably post the rest of the configuration then for clarity. – jmreicha – 2015-10-25T19:39:01.497

The webapp redirects you to / instead of /shutter? Then the webapp doesn't know what's its home directory. If you can set it then you should change / to /shutter or you can use nginx's sub_filter module: http://nginx.org/en/docs/http/ngx_http_sub_module.html

– unNamed – 2017-03-01T16:00:32.913

Answers

0

From the little information you gave, it could be necessary to add

proxy_redirect / /shutter;

So in case the application creates a redirect, nginx can replace it with the subfolder you're using.

Also (as stated in my comment) it could be possible that the application uses a mix of absolute and relative paths. Then you need to replace that with sub_filter module.

sub_filter_types text/xml text/html;
sub_filter 'http://localhost:8989/' '/';
sub_filter_once off;

unNamed

Posted 2015-10-24T15:07:28.267

Reputation: 371