• Hello,

    i tried to find help with this via google and reddit homelab. no succes for no. so sry but i think i have to bother you guys now. ??

    Need Help with WordPress behind an Apache Reverse Proxy (no CSS)
    byu/Blackraz0r inhomelab

    basically it should be easy:

    i have an apache reverse proxy wich servers my whole lab. Organizr, Nextcloud, Wekan, all those webservices, you get the idea.

    but it just does not work with WP

    so far my reverse proxy config looks like this:

    Docker Compose file:

    version: '2'
    
    services:
       db:
         image: mysql:5.7
         volumes:
           - wp_db_data:/var/lib/mysql
         restart: always
         environment:
           MYSQL_ROOT_PASSWORD: wordpress
           MYSQL_DATABASE: wordpress
           MYSQL_USER: wordpress
           MYSQL_PASSWORD: wordpress
    
       wordpress:
         image: wordpress:latest
         volumes:
           - wp_data:/var/www/html
         ports:
           - 9500:80
         restart: always
         environment:
           WORDPRESS_DB_HOST: db:3306
           WORDPRESS_DB_USER: wordpress
           WORDPRESS_DB_PASSWORD: wordpress

    Reverse Proxy Apache HTTP:80

    <VirtualHost home.mydomain.de:80>
    ServerName home.mydomain.de
    ProxyPass / https://10.250.30.220:9500/
    ProxyPassReverse / https://10.250.30.220:9500/
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =home.mydomain.de
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    </VirtualHost>

    then i let certbot create a file for HTTPS:443:

    <IfModule mod_ssl.c>
    <VirtualHost home.mydomain.de:443>
    ServerName home.mydomain.de
    ProxyPass / https://10.250.30.220:9500/
    ProxyPassReverse / https://10.250.30.220:9500/
    
    SSLCertificateFile /etc/letsencrypt/live/home.mydomain.de/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/home.mydomain.de/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
    </IfModule>

    normaly my service would be accesible via home.mydomain.de now.
    with WP this is only partially the case. it looks like this:

    View post on imgur.com

    can someone tell my what the error is ?
    pls be patient with me. i look for the last magical piece of code to add in the reverse proxy config to make it work. pls help me, im kinda frustrated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t know the answer but maybe you might seek some help over at Stack Exchange. I imagine someone there knows something about this.

    https://stackexchange.com/sites

    If they don’t know then they probably know where to send you next.

    It’s not a WordPress issue!

    It might be helpful to add to wp-config.php the following line:
    $_SERVER['HTTPS'] = 'on';
    Just before the line:
    require_once(ABSPATH . 'wp-settings.php');

    • This reply was modified 4 years, 10 months ago by Condless.

    Hello everyone… I’m new to WordPress and I’m trying to setup a website following the tutorials that there are on the web but I’m stuck because the apache server doesn’t turn green on MAMP panel and therefore I can’t open the page. I’ve changed the port 80 to 8080 as I’ve been trying to mend this with the help of tutorials. No luck. Still the same state. I’ve tried installing xamp and there it turns on green, but then I don’t know how to follow to the next step.
    If anyone could give me a hand I’d be very really happy.
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP behind Apache reverse Proxy not working’ is closed to new replies.