2

I've got this RewriteRule, And I can't make it work with nginx :

RewriteRule  ^/espace-annonceurs/@@contenu-des-espaces-annonceurs http://mywebsite.com/@@contenu-des-espaces-annonceurs [L,P]

The Proxy is because it make an ajax request.

I've tried a lot of things, with location, proxy_pass, rewrite, and so on...

Thanks by advance.

Jihaisse
  • 977
  • 5
  • 24

2 Answers2

0

Actually you need proxy request to your host to some other host. That's job for proxy module. The simplest config would be like this:

location /espace-annonceurs/@@contenu-des-espaces-annonceurs {
    proxy_pass http://mywebsite.com/@@contenu-des-espaces-annonceurs;
}

Probably you'll need some proxy_set_headers directive.

Read documentation http://nginx.org/r/proxy_pass.

Alexey Ten
  • 13,794
  • 6
  • 44
  • 54
-1

So a simple rewrite would do.

rewrite ^/(espace-annonceurs/@@contenu-des-espaces-annonceurs)$ http://example.com/$1;
n1xx1
  • 1,971
  • 20
  • 26
  • 1
    yes, but this doesn't work because of cross-domain, that's why we have a Proxy mod on this with apache. – Jihaisse Apr 28 '14 at 10:07