At the moment, on one host there is a structure symfony2.domain.com ( / var / www / symfony2 ) - a route for a working symphony 2 of the project domain.com ( /var/www/domain.com ) - a site on another platform.

The task is to make Symphony available over domain.com/symfony2 with no redirect (the subdomain will be closed)

While the simplest but crooked idea in the implementation is to organize the directory structure / var / www / symfony2 / site / base (transfer the web to the base) In Apache DocumentRoot, install to / var / www / symfony2 / site and then still have to ignore the git site directory except base

Is it possible to do this without destroying the file system structure?

    1 answer 1

    A better solution was to install ngnix as a front-end web server (on port 80), domain.com at 8080, symfony2 at 8081 available only locally. And using proxy_pass to organize routing.

    Ngnix configuration example

     server { ... location / { proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } location /symfony2 { proxy_pass https://127.0.0.1:8081/; proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; } ...