0

I had an apache virtualhost config that redirects "http://host.domain.com/~userdir" to another host:

RewriteRule ^/~(.+) http://anotherhost.domain.com/~$1 [R,L]

But I'm having trouble to migrate this config to Nginx. Anyone could help me please?

2
  • 1
    Questions seeking installation, configuration or diagnostic help must include the desired end state, the specific problem or error, sufficient information about the configuration and environment to reproduce it, and attempted solutions. Questions without a clear problem statement are not useful to other readers and are unlikely to get good answers Commented Mar 29, 2023 at 19:13
  • Welcome to ServerFault. What have you tried so far? Commented Mar 30, 2023 at 16:24

1 Answer 1

0

Here it is:

location /~ { rewrite ^/~(.+) http://anotherhost.domain.com/~$1 redirect; } 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.