Discourse Docker + Preexisting WP sites on apache2


(GavinRainey) #1

Hi All,

I have just installed discourse with docker to resolve some of my previous issues. All is well now on that front however I am now stuck with some new problems and would like to know what the best way to resolve them is.

I have discourse set up as per the guide so it is running on nginx on port 80.

However I had two sites running on apache2 before which wont start because nginx has port 80 online already.

What can I do to resolve this please?

Thanks in advance

Gav


(Archon) #2
https://meta.discourse.org/t/nginx-nginx-and-docker/13299/last?source_topic_id=13974

If you need some help, and just want apache2 (real) -> nginx (docker), just ask.
I have the same configuration but Nginx (real, php5-fpm) -> Nginx (docker, port 8080).


(GavinRainey) #3

Hi @archon432 and thanks for the reply, I read through this earlier and some help would be great please.

Whatever I need to do.

Man on man I love this site, I know I made the right choice with discourse.


(Archon) #4

I am not sure if this will work and I highly suggest you use Nginx instead of Apache:
(replace forums.domain.com with your forum subdomain)

Apache (not tested!):

RewriteEngine On
RewriteBase /

<VirtualHost *:80>
ServerName forums.domain.com

ProxyPreserveHost On
ProxyPass / http://forums.domain.com:8080/
ProxyPassReverse / http://forums.domain.com:8080/
</VirtualHost>

Nginx:

server {
    server_name forums.domain.com;
    listen 80;

    location / {
       access_log off;
       proxy_pass http://forums.domain.com:8080;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Make sure to edit container/app.yml:

expose:
  - "8080:80"
  - "2222:22"