user2331871
user2331871

Reputation: 23

Rewrite URL in Nginx proxy + apache setup

I'm working in python/django with apache and a Nginx proxy.

I need to transform some URLs like these:

www.mydomain.com/client_A/

www.mydomain.com/client_B/

to

www.mydomain.com/clients/1/

www.mydomain.com/clients/2/

I would do a rewrite in the Nginx configuration, but the problem is that this should Not be visible to the user, rather he should keep seeing the URL as www.mydomain.com/client_A/ and Not as the internal URL.

The main idea is to do this in the Nginx/Apache configuration

Thanks in advance.

Upvotes: 2

Views: 525

Answers (2)

lalit
lalit

Reputation: 3433

You might want to look into the following post for related question.

apache reverse proxy changes url

The idea is to use a reverse proxy with Apache to keep URLs same.

Upvotes: 0

Spc_555
Spc_555

Reputation: 4121

I believe

 rewrite ^/client_A/(.*)$ /clients/1/$1 last;

in nginx config should work.

Upvotes: 2

Related Questions