Score:0

Ubuntu Apache Proxy Pass causing an ERR_ABORTED 404 (Not Found)

us flag

I running two Node.js servers on a Ubuntu EC2 instance listening on two different ports...

In front, I have an Apache server that is acting as a proxy to direct the client to the correct application based on their URL path. I'm trying to get Apache to direct the client to http://127.0.0.1:1337/admin whenever they go to the /admin URL path. However, whenever I go there the browser is throwing the following errors.

GET http://myserver.com/admin/runtime~main.f9af2365.js net::ERR_ABORTED 404 (Not Found)

GET http://myserver.com/admin/main.2e76d653.js net::ERR_ABORTED 404 (Not Found)

It seems as though the server can't locate the build files required to run the application. However if I go the path http://myserver:1337/admin directly it works perfectly fine. This seems to tell me that the issue has to do with my proxy server, I'm just not sure what it could be.

The proxy pass to http://127.0.0.1:8080/ works perfectly fine.

Here is my /etc/apache2/sites-available/000-default.conf file.

<VirtualHost *:80>
    ServerName myserver.com
    ServerAlias myserver.com

    ProxyPreserveHost On

    ProxyPass /admin http://127.0.0.1:1337/admin/
    ProxyPassReverse /admin http://127.0.0.1:1337/admin/

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/

    ErrorLog ${APACHE_LOG_DIR}/efh-app-web_error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/efh-app-web_access.log combined
</VirtualHost>

I've tried many different guides and forums about issues similar to this one however none of them have seemed to have resolved my issue. I'm fairly new to web development and server configuration so I apologize if there is a lack of detail. Please let me know if you require more information.

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.