简体   繁体   中英

Using ProxyPass takes server offline

I've been scratching my head over how to use ProxyPass to get mysite.com/things pointing to a web app I'm running on localhost:3000 (verified running).

I've enabled the needed mods (and verified they're running) by running a2enmod.

sudo a2enmod proxy
sudo a2enmod proxy_http

My vhost file:

<VirtualHost *:80>
        ServerName mysite.com
        ServerAlias www.mysite.com
        
        ProxyPass /things/ http://localhost:3000
        ProxyPassReverse /things/ http://localhost:3000

        DocumentRoot /var/www/production/mysite
        <Directory /var/www/production/mysite>
                Options -Indexes +FollowSymLinks +MultiViews
                AllowOverride All
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/mysite.log

        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/mysite.log combined

</VirtualHost>

Restarting the server with this just takes it offline. In fact it takes all sites running off this server offline. Removing the ProxyPass parts makes it work again. Not sure what I'm doing wrong here? Anything I'm missing?

Your configuration looks fine but without any error log there's no way to find out what's wrong. Also don't forget to enable and secure balanceManager ( https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html#manager ).

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