Welcome! Log In Create A New Profile


Reverse proxy forward a tag in URL

Posted by Vladimir123! 
Reverse proxy forward a tag in URL
March 09, 2020 11:05AM
I want to add and forward all traffic to `localhost/admin/` instead of `localhost/`.
App listen to those paths:
- `localhost/` (then gets 302 to `localhost/login` by application),
- `localhost/overview`,
- `localhost/books/details`,etc.

I want admin user to use those urls:
- `localhost/admin/`(to get 302 `localhost/admin/login` by application)
- `localhost/admin/overview`
- `localhost/admin/book/details`

With my reverse proxy (see below):
- `localhost/admin/` I get 302 `localhost/login` by application, /admin tag is not forwarded

I could use also `ingrees-nginx-controller` instead of mounting file. In docker nginx.conf (or similar to k8s) server {
listen 80 default_server;
listen [: : ]: 80 default_server;
location /admin {
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_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host/admin;
proxy_pass http: //<conteiner2>.docker-network;

Edited 2 time(s). Last edit at 03/09/2020 11:14AM by Vladimir123!.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 88
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready