The problem is this:
I configured the route in the Symfony2, the prefixes are respectively:
/admin/api/wap...
such as
Now I want to access these three corresponding routes by accessing the three self-domains, respectively
admin.domain.com => /admin/*api.domain.com => /api/*wap.domain.com => /wap/*
At present under the Nginx configuration, but it does not work, want to see you have any ideas and methods of experience, pointing out, is now trapped.
server { listen 80; server_name domain.com ~^(?
.+)\.domain\.com; ..... location / { index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$subdomain$1 last; } ......}
I hope you are pointing out ... Thank you.
Reply content:
The problem is this:
I configured the route in the Symfony2, the prefixes are respectively:
/admin/api/wap...
such as
Now I want to access these three corresponding routes by accessing the three self-domains, respectively
admin.domain.com => /admin/*api.domain.com => /api/*wap.domain.com => /wap/*
At present under the Nginx configuration, but it does not work, want to see you have any ideas and methods of experience, pointing out, is now trapped.
server { listen 80; server_name domain.com ~^(?
.+)\.domain\.com; ..... location / { index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$subdomain$1 last; } ......}
I hope you are pointing out ... Thank you.
Without Nginx, this feature is supported by the new routing component
See below Http://symfony.com/doc/current/components/routing/hostname_pattern.html
Nginx default does not support PathInfo, note configuration pathinfo. Symfony routing requires PathInfo mode support.