Hi Francis Ok. Many thanks for your interest of my problem. Best regards Nicoby nicocolt - Nginx Mailing List - English
Hello Francis, server { listen *:80; server_name domain.fr www.domain.fr subdomain.domain.fr; root /var/www/domain.fr/web; if ($http_host = "subdomain.domain.fr") { rewrite ^(?!/\b(bar|stats|error)\b)/(.*)$ /bar/$2 last; } index index.html index.htm index.php index.cgi index.pl index.xhtml;by nicocolt - Nginx Mailing List - English
Hi Francis, I have set a new server block, but i'm facing with the initial problem. So let me re-explain it. Now i have: server name stuff.domain.fr root /var/www/domain.fr/web/subdomain; In the subdomain directory i have foo firectory /var/www/domain.fr/web/subdomain/foo/ so now in my browser when i reached stuff.domain.fr i see the page index.html in subdomain folder. But ifby nicocolt - Nginx Mailing List - English
Hello, you're right, my rewrite says that my request is handle like http://subdomain.domain.fr/subdomain/directory/. But it is not that i want. I want that my request is handled like this: http://subdomain.domain.fr/directory/ and i don't want see the intermediate path. I don't understand how to proceed in order to see only http://subdomain.domain.fr/directory/ instead of http://subdomainby nicocolt - Nginx Mailing List - English
Hello Thanks for your reply. If I remove the three lines, i get a 404 error. As a reminder, and maybe a little bit more clear :) here is the configuration. Here is the directory path: /var/www/domain.fr/web/subdomain/directory my nginx conf is: root /var/www/domain.fr/web if ($http_host = "subdomain.domain.fr") { rewrite ^(?!/\b(subdomain|stats|error)\bby nicocolt - Nginx Mailing List - English
Hello, I have an issue with a rewrite rule for redirect to a subdomain. Here it is: if ($http_host = "subdomain.domain.fr") { rewrite ^(?!/\b(subpath|stats|error)\b)/(.*)$ /subpath/$2 last; } if in my browser i write: host.domain.fr/admin (without last /), then I'm redirected to host.domain.fr/host.domain/admin/ (with a 404 error of course) But if i write: hosby nicocolt - Nginx Mailing List - English