Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
Reverse proxy trying to redirect subdirectory to Symfony specific route

I have this specific problem where i have a reverse proxy using apache that redirect to 2 websites depending of url, example.com that redirect to a server and example.com/subdirectory/ to a server with a symfony and i want it to this specific route /subdirectory/ in symfony and not the symfony root

So far here is my conf on the reverse proxy

SSLProxyEngine On
ProxyPreserveHost On
ProxyPass /subdirectory/ https://12.34.56.78/subdirectory/
ProxyPassReverse /subdirectory/ https://12.34.56.78/subdirectory/
ProxyPass /subdirectory https://12.34.56.78/subdirectory/
ProxyPassReverse /subdirectory https://12.34.56.78/subdirectory/
ProxyPass / https://12.34.56.789/
ProxyPassReverse / https://12.34.56.789/

And here is symfony .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On


    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


    #RewriteCond %{ENV:REDIRECT_STATUS} ^$
    #RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=302,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

This configuration gives nothing but too many redirect errors

I tried removing subdirectory in reverse proxy like that

SSLProxyEngine On
ProxyPreserveHost On
ProxyPass /subdirectory/ https://12.34.56.78/
ProxyPassReverse /subdirectory/ https://12.34.56.78/
ProxyPass /subdirectory https://12.34.56.78/
ProxyPassReverse /subdirectory https://12.34.56.78/
ProxyPass / https://12.34.56.789/
ProxyPassReverse / https://12.34.56.789/

I can access the symfony homepage with https://www.example.com/subdirectory/ and a lot of 404 on assets but i want it to be the subdirectory route of the symfony.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda