简体   繁体   中英

Apache 2.4 Reverse proxy to Node Application on Docker

I have a dedicated server on Apache 2.4 and I made a node application which is running on a Docker container and listenning on the port 5847

So I am trying to configure my apache to make a reverse Proxy to http://my.url.com:5847 on a Debian 8 machine

When I made this, I have the start page of apache "It Works" but not my application. Of course, If I check http://my.url.com:5847 in my navigator, it works fine, but why my reverse Proxy doesn't work?

This is my my.url.com.conf apache config file :

<VirtualHost *:80>
    ServerAdmin hello@my-url.com
    ServerName my.url.com
    ProxyPass "/" "http://my.url.com:5847/"
    ProxyPassReverse "/" "http://my.url.com:5847/"
</VirtualHost>

So I'm quite desesperate, I also tried to add

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

I also tried with Required all granted , I tried with the <Location /> directive, with ProxyRequests Off and On too but nothing is working and I don't understand what is going wrong...

Can you help me please? What am I doing wrong?

This wks for me (apache 2.4, node.js runs in 192.168.32.35 on port 3003), on Debian 8

<VirtualHost feed.mydomain.net:3003>
    ServerName feed.mydomain.net
    ServerAdmin yves@mydomain.com
    DocumentRoot /var/www/html

    <Location />
        ProxyPass http://192.168.32.35:3003/
        ProxyPassReverse http://feed.mydomain.net:3003/
        Order allow,deny
        Allow from all
    </Location>

    LogLevel trace1 ssl:warn rewrite:trace1

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Okay, so ... I think I found my error, I was writing an conf archive without .conf extension in sites-enabled and that's why apache wasn't taking my configuration... I re-made my configuration file in sties-enabled and then enabled it from apache with a2ensite my.url.com.conf and now it works...

Sorry for the bas question, nothing to do with reverse proxy!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM