Welcome! Log In Create A New Profile

Advanced

second path redirect does not work

Posted by whiteadi 
second path redirect does not work
April 08, 2016 02:53AM
Hi,

I have first http to https redirects - works

then the path /bamboo to redirect to http:...:8085 - works

second path redirect from /api to http:...:8080 does not work it says not found (https://mydomainname/api):

# Redirect http -> https
#
server {
listen 80;
server_name _;
return 301 https://$host$request_uri;

rewrite ^/bamboo(.*)$ http://mydomainname:8085/$1 last;
rewrite ^/api(.*)$ http://mydomainname:8080/$1 last;
return 403;
}
Re: second path redirect does not work
April 08, 2016 03:06AM
Actually first path redirect does not work anymore, it also redirects to https and say 404 not found.

So: how can I have the 2 different path redirects to http with the different ports and rest http tp https ?
Re: second path redirect does not work
April 08, 2016 03:53AM
tried now with location:

server {
listen 80;
server_name _;
return 301 https://$host$request_uri;

location /bamboo {
rewrite ^/bamboo(.*)$ http://mydomainname:8085/$1 last;
}

location /api {
rewrite ^/api(.*)$ http://mydomainname:8080/$1 last;
}

return 403;
}

Still no success :(
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 322
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