On Mon, Jul 3, 2023 at 10:44 PM Richard <lists-apa...@listmail.innovate.net>
wrote:

>
>
> > Date: Monday, July 03, 2023 22:22:04 +0530
> > From: Kaushal Shriyan <kaushalshri...@gmail.com>
> >
> > On Mon, Jul 3, 2023 at 10:10 PM Richard wrote:
> >
> >>
> >> > Date: Monday, July 03, 2023 20:35:36 +0530
> >> > From: Kaushal Shriyan <kaushalshri...@gmail.com>
> >> >
> >> > I have initiated a new thread to discuss the new issue. I am
> >> > running node.js application on port 8000 and Apache HTTP server
> >> > on CentOS Linux release 7.9.2009 (Core)
> >> >
> >> ># node --version
> >> > *v16.20.0*
> >> ># httpd -v
> >> > Server version: *Apache/2.4.57 (IUS)*
> >> > Server built:   Apr  7 2023 14:49:47
> >> >#
> >> >
> >> > *#cat /etc/httpd/conf.d/phpnodejs.conf*
> >> > <VirtualHost *:80>
> >> >     ServerName phpnodejs.mydomain.com
> >> >     Redirect / https://phpnodejs.mydomain.com/
> >> >  </VirtualHost>
> >> > <VirtualHost *:443>
> >> > DocumentRoot /var/www/html/phpcode/cardium-version-1/web
> >> >         DirectoryIndex index.php
> >> > ServerName phpnodejs.mydomain.com
> >> > Header add Access-Control-Allow-Origin "*"
> >> >         SSLEngine on
> >> >         SSLCertificateFile /etc/letsencrypt/live/
> >> > phpnodejs.mydomain.com/cert.pem
> >> >         SSLCertificateKeyFile /etc/letsencrypt/live/
> >> > phpnodejs.mydomain.com/privkey.pem
> >> >         SSLCertificateChainFile /etc/letsencrypt/live/
> >> > phpnodejs.mydomain.com/chain.pem
> >> >         Header always set Strict-Transport-Security
> >> > "max-age=63072000; includeSubDomains"
> >> >         ProxyPass /index.php !
> >> >         ProxyPassMatch "^/(.+)$" "http://localhost:8000/$1";
> >> >
> >> > <Directory "/var/www/html/phpcode/cardium-version-1/web">
> >> > DirectoryIndex index.html index.php
> >> > Options FollowSymLinks
> >> > AllowOverride All
> >> >         Require valid-user
> >> >         AuthType Basic
> >> >         AuthName "Restricted Content"
> >> >         AuthUserFile
> >> > /var/www/html/phpcode/cardium-version-1/web/.htpasswd
> >> > </Directory> </VirtualHost>
> >> >
> >> > When I hit  https://phpnodejs.mydomain.com it works perfectly
> >> > fine. But when I click on any of the links on the home page
> >> > which adds /en at the end of all the links, I get Not Found on
> >> > the browser for all the links.
> >> >
> >> > For example https://https://phpnodejs.mydomain.com/en returns Not
> >> > Found.                      https://
> >> > https://phpnodejs.mydomain.com/en/community/webinars returns Not
> >> > Found.
> >> > https://phpnodejs.mydomain.com/en/community/articles returns Not
> >> > Found.
> >> >
> >> > When I hit https://phpnodejs.mydomain.com/nodejssl/server.js
> >> > works perfectly fine as expected.
> >> >
> >> > [image: image.png]
> >> >
> >> > cat /var/log/httpd/ssl_access_log
> >> > 172.16.16.45 - - [03/Jul/2023:20:09:27 +0530] "GET
> >> > /en/community/webinars HTTP/1.1" 404 9
> >> > 172.16.16.45 - - [03/Jul/2023:20:09:35 +0530] "GET
> >> > /en/apis/use-cases HTTP/1.1" 404 9
> >> > 172.16.16.45 - - [03/Jul/2023:20:09:45 +0530] "GET
> >> > /en/support/contact-us HTTP/1.1" 404 9
> >> > 172.16.16.45 - - [03/Jul/2023:20:10:02 +0530] "-" 408 -
> >> > 172.16.16.45 - - [03/Jul/2023:20:09:12 +0530] "GET
> >> > /__es-dev-server__/message-channel HTTP/1.1" 200 30
> >> > 172.16.16.45 - drupaladmin [03/Jul/2023:20:11:00 +0530] "GET /
> >> > HTTP/1.1" 200 45339
> >> > 172.16.16.45 - - [03/Jul/2023:20:11:03 +0530] "GET
> >> > /en/community/webinars HTTP/1.1" 404 9
> >> > 172.16.16.45 - - [03/Jul/2023:20:11:09 +0530] "GET
> >> > /en/apis/use-cases HTTP/1.1" 404 9
> >> > 172.16.16.45 - - [03/Jul/2023:20:11:11 +0530] "GET /en HTTP/1.1"
> >> > 404 9 172.16.16.45 - - [03/Jul/2023:20:11:29 +0530] "-" 408 -
> >> >
> >>
> >> You need to make some efforts to debug things yourself. Start by
> >> looking in the *appropriate* error_log file for the entries
> >> *matching* the above access_log 404s. I suspect that that could
> >> enlighten you.
> >>
> >>
> >>
> >> ------------------------------------------------------------------
> >> --- To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For
> >> additional commands, e-mail: users-h...@httpd.apache.org
> >>
> >>
> > Thanks Richard for the hint and appreciate it. Using the below
> > config file while commenting both ProxyPass and ProxyPassMatch
> > directive it works perfectly fine.
> >
> ># ProxyPass /index.php !
> ># ProxyPassMatch "^/(.+)$" "http://localhost:8000/$1";
> >
>    . . .
> >
> > I will continue to debug and analyse the cause of the "Not Found"
> > issue. Thanks in advance.
> >
>
> Look at, and understand, the implications of the syntax of those
> proxypass lines in the context of where your content is. The
> documentation page referenced previously:
>
> <https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassmatch>
>
> should help. Are the pages that you are getting 404s on on the proxy?
>
>
Thanks Richard for the quick response. When I enable the below, I encounter
404 while hitting the main webpage https://phpnodejs.mydomain.com/en.

# ProxyPass /index.php !
# ProxyPassMatch "^/(.+)$" "http://localhost:8000/$1";

<Directory "/var/www/html/phpcode/cardium-version-1/web"> as per
/etc/httpd/conf.d/phpnodejs.conf
# pwd
/var/www/html/phpcode/cardium-version-1/web
# ls -l
total 36
-rw-rw-r--  1 apache apache  315 May 15 18:21 autoload.php
drwxrwxr-x 12 apache apache 4096 Apr 26 18:23 core
-rw-rw-r--  1 apache apache 1507 Mar  8 19:40 example.gitignore
-rw-rw-r--  1 apache apache  549 Mar  8 19:40 index.php
-rw-rw-r--  1 apache apache   94 Mar  8 19:40 INSTALL.txt
drwxrwxr-x  4 apache apache   52 Apr 11 20:51 libraries
drwxrwxr-x  5 apache apache   75 Mar  8 19:38 modules
drwxrwxr-x  2 apache apache   24 Mar  8 19:16 profiles
-rw-rw-r--  1 apache apache 3205 Mar  8 19:16 README.md
-rw-rw-r--  1 apache apache 1706 Apr 27 22:33 robots.txt
drwxrwxr-x  3 apache apache  130 Mar  8 19:40 sites
drwxrwxr-x  4 apache apache   53 Mar  8 19:39 themes
-rw-rw-r--  1 apache apache  804 Mar  8 19:40 update.php
-rw-rw-r--  1 apache apache 4039 Mar  8 19:40 web.config
#

Is there a way to enable debug logs for ProxyPass and ProxyPassMatch
directive?

Please suggest and guide me.  Thanks in advance.

Best Regards,

Kaushal

Reply via email to