• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Apache2 Reverse-Proxy for NodeBB - Snippet

Scheduled Pinned Locked Moved Tutorials
apache2nodebbproxyserver
3 Posts 2 Posters 650 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dogsD Offline
    dogsD Offline
    dogs
    wrote on last edited by dogs
    #1

    Hello Guys!

    I was trying to get Apache2 to work as a proxy. Finally I did it but I have had a few issues:

    • first It wasn't reachable at all
    • then Images just fetched still in HTTP
    • suddenly I had problems with WebSockets, they didn't work
    • with this fixed: login wasn't working anymore
    • with this fixed I wasn't able to use https:// in my config.json
    • .. and so on and so an

    I struggled about 3 hours to get it work. Now my NodeBB-instance is running under the hood of Apache2 - delivered by a subdomain. Everything is working. So I just want to share my Apache2 configuration so that you do not have to struggle with the same things.


    Apache2 configuration:

    <IfModule mod_proxy.c>
            ProxyPass /.well-known/acme-challenge !
    </IfModule>
    
    Alias /.well-known/acme-challenge /home/dogs/www/.well-known/acme-challenge
    
    ProxyPass / http://127.0.0.1:4567/
    ProxyPassReverse / http://127.0.0.1:4567/
    
    # Required for websockets
    RewriteEngine on
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
    RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
    RewriteRule .* ws://localhost:4567%{REQUEST_URI} [P]
    
    # Required to tell its external port
    RequestHeader set X-Forwarded-Port "443"
    RequestHeader set X-Forwarded-Proto "https"
    

    Maybe you can remove

    Alias /.well-known/acme-challenge /home/dogs/www/.well-known/acme-challenge or change it to another path! 🙂

    For SSL-Encryption you can simply use certbot or whatever. Apache2 is still fully customizable and only works as a reverse proxy.

    Bye bye

    gotwfG 1 Reply Last reply
    2
  • gotwfG Offline
    gotwfG Offline
    gotwf Community Rep
    replied to dogs on last edited by
    #2

    @dogs Curious, had you seen this https://docs.nodebb.org/configuring/proxies/apache/

    Something there not working for you? Inquiring minds are curious. 🐕

    dogsD 1 Reply Last reply
    1
  • dogsD Offline
    dogsD Offline
    dogs
    replied to gotwf on last edited by
    #3

    @gotwf I'm not sure it's been weeks ago I wrote this. 😄

    Maybe I did not find this or something didn't work for me. I can't tell you...

    Greets

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development