Score:0

Proxy apache2 to container gives 404 error

hk flag

I am new to apache2 I've followed every tutorial on the internet, I think I've seen every question but it didnt help. The problem is that

  • My container contains flask app.
  • Container listens to 45654 port.
  • assume my hostname is "myuni.edu" which is hosting lots of php things though apache2 rn which are available
  1. curl http://localhost:45654 from host machine works and returns html text.
  2. curl http://myuni.edu from remote machine (my laptop) works and returns html text.
  3. My /etc/apache2/sites-available/newtest.conf file:
<VirtualHost *>
    ServerName myuni.edu
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia On
    ProxyPass /newtest http://127.0.0.1:45654/
    ProxyPassReverse /newtest http://127.0.0.1:45654/
</VirtualHost>
  1. /var/log/apache2/access.log shows "GET /newtest HTTP/1.1" 404 492 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/22.12.2 QtWebEngine/5.15.12 Chrome/87.0.4280.144 Safari/537.36"
  2. sudo docker logs port_testing shows only 200 requests from curl-ing localhost
  3. docker-compose.yml file:
version: "3"
services:
  web:
    image: basic_flask_test
    container_name: port_testing
    environment:
      - SCRIPT_NAME=/newtest
    build: .
    ports:
      - "45654:5000"

let me know if I should provide any other details. I don't know where else to go

in flag
try ProxyPass /newtest/ http://127.0.0.1:45654/, with a slash after newtest.
Innokesha avatar
hk flag
@LaurentiuRoescu ty for the comment but it didnt work :(
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.