Centos 7.5 apache proxy for .net core

apache-2.4centos7net

I am following the instructions to setup apache with .netcore as a proxy server. Here is my vhost.

<VirtualHost *:*>
    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
</VirtualHost>
<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/
    ServerName localhost.
    ServerAlias *.pointtechsol.com
    ErrorLog ${APACHE_LOG_DIR}pts-error.log
    CustomLog ${APACHE_LOG_DIR}pts-access.log common
</VirtualHost>

This is the error that I am getting:

service httpd configtest
[Mon Jan 07 17:46:41.520033 2019] [core:warn] [pid 5971] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Jan 07 17:46:41.520137 2019] [core:warn] [pid 5971] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 2 of /etc/httpd/conf.d/pts.conf:
Unrecognized header format %

I have looked but have been unable to locate the solution. Let me know what other details I can post for help.

Tried this but get same error:

<VirtualHost *:*>
    RequestHeader set "X-Forwarded-Proto" "expr=%{REQUEST_SCHEME}"
</VirtualHost>

Best Answer

The problem appears to be here:

    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

The documentation indicates that the expression containing any special characters should be quoted, i.e.:

    RequestHeader set "X-Forwarded-Proto" "expr=%{REQUEST_SCHEME}"
Related Topic