Running other websites on the same machine as Discourse

(Felix Freiberger) #95

It looks like it works both ways :slight_smile:

(paul) #96

I’m tryn to set up discourse on my laptop to play around.
I’ve installed nginx, docker and discourse while following this the instruction this thread was starting with.

There’s just one line where I don’t know what to put into : server_name.

What I want is that once I type in a specific ip in my browser that it shows discourse.


So I have used OP’s settings to setup discourse to run in parallel with other sites(with SSL)
And it seems like after that, the “Last IP Address” is always
Even though this is not a show stopper, it would be nice if we can get rid of this “bug”

Thank you.

(Felix Freiberger) #98

Are you 100% certain that you included proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; in your configuration?


Yes, I am 100% sure I have written that into my config.
I do have the redirecting http to https set also, though I would think it
shouldn’t matter.
And I’m using the latest discourse, v1.6.0beta10 as of now

(Felix Freiberger) #100

Does your setup differ from the one described in the howto in any other way, e.g. do you have an additional proxy?


one, I have php running on the same machine, different path,
two, the “server _name” have multiple domain,
Three, it’s running on linode, not digital ocean~

Also, it’s behind cloudflare(free plan), though I have another server with
the same setup, minus cloudflare, it’s still showing

That is all I can think of…

(Felix Freiberger) #102

I’m pretty sure this needs additional configuration here.


That’s what I thought too, but I do have another discourse server with the
same setup, minus the cloudflare, that is also showing every login as

(Evan G) #104

Hey, all, I’m trying to run the quick start guide, but ./discourse-setup won’t work because I’m on a server that has nginx running already. I know I’m supposed to modify my app.yml file, but I can’t because it doesn’t exist yet. What should a minimal app.yml file look like?

(this is more of a general note that we should take this into consideration in the bootstrapping process rather then any specific request for help—I can probably muddle through it, personally. discourse-setup looks like a pretty straightforward script)

(cpradio) #105

it is stored in samples/, by default it copies standalone.yml to app.yml inside the containers folder.

(Evan G) #106

thanks! I went with commenting out the check_ports lines and the start and the end

(Dylan Hunt) #107

Ok I was able to follow the tutorial 100% fine, but in the end, It’s ALMOST working but not quite :slight_smile:

Getting a nginx 502 bad gateway


For this step:
This file was blank. Was that normal? How does it know to look for discourse.conf if blank? I feel like I’m missing something that has to do with this file.

If I don’t use SSL (https), should I comment out- "templates/sshd.template.yml" ?

there is no/var/discourse/shared/standalone/nginx.http.sock – this is likely the answer. Searching for this…

For this step:
Be sure to remove the next line containing
- "80:80" # fwd host port 80 to container port 80 (http)
This line was completely removed, but nothing was replaced … shouldn’t it be SOME port to port 80? Like"1234:80" ?"

EDIT 5: Fixed itself magically wtf? lol

(Daniel Lynch) #108

I attempted to follow this tutorial, and I got it working NOT using a unix domain socket, but rather setting up discourse to listen on port 8081 and then forwarding to that from nginx. However, I’d like to get it to work on a unix domain socket.

My site, like the poster above, does not use https internally. So I was looking for a file called “nginx.http.sock” in /var/discourse/shared/web-only/

There was no such file after restarting the container. And in the log file for nginx it said: “2016/08/23 19:45:45 [crit] 22330#22330: *1 connect() to unix:/var/discourse/shared/web-only/nginx.http.sock failed (2: No such file or directory) while connecting to upstream”

And yes, I did include “templates/web.socketed.template.yml” in my web_only.yml file.

@dylanh724 any clue why/how that file showed up magically? Maybe I was impatient and need to wait longer? :stuck_out_tongue:

(Felix Freiberger) #109

How does your app.yml look like, minus the SMTP credentials?

(Graeme Stuart) #110

On CentOS 7 my nginx doesn’t like spdy.

nginx: [warn] invalid parameter "spdy": ngx_http_spdy_module was superseded by ngx_http_v2_module in /etc/nginx/conf.d/discourse.conf:8
nginx: [warn] invalid parameter "spdy": ngx_http_spdy_module was superseded by ngx_http_v2_module in /etc/nginx/conf.d/discourse.conf:8
nginx: [warn] invalid directive "spdy_headers_comp": ngx_http_spdy_module was superseded by ngx_http_v2_module in /etc/nginx/conf.d/discourse.conf:18
nginx: [warn] invalid directive "spdy_keepalive_timeout": ngx_http_spdy_module was superseded by ngx_http_v2_module in /etc/nginx/conf.d/discourse.conf:19

Any ideas?

(Kane York) #111

Switch it out with http2.

(Graeme Stuart) #112


Should the main topic be updated to reflect this?

What about the spdy_headers_comp and spdy_keepalive_timeout?

Should they become http2_headers_comp and http2_keepalive_timeout?

(Graeme Stuart) #113

Now I have this working but I’m getting a bad gateway 502 in the browser.

(Vinoth Kannan) #114

As per recent code in docker no need for both spdy_headers_comp and spdy_keepalive_timeout for ssl enabled nginx config.

Also I hope http2_headers_comp and http2_keepalive_timeout also not needed.

And yes main post should be updated.