Right! I’ve dumbly applied the config in the page listed above, compared to other nginx config files and couldn’t understand why the proxy wouldn’t listen to 80:443 for discourse…
Here’s what I expected to see:
server {
listen 80;
server_name discourse.mydomain.com;
return 301 https://$host$request_uri; # routing to https
}
server {
listen 443 ssl
listen [::]:443 ssl;
server_name discourse.mydomain.com;
ssl_certificate /etc/letsencrypt/live/discourse.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/discourse.mydomain.com/privkey.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location / {
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:; # using socket
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sorry Stephen for the confusion, I just used the name of the tool which is referenced in the article. I understand that NPM and nginx (as a) proxy manager are different things, this is why I used capital letters…
This is exactly what I’m trying to do and I understand you cannot support on this. However, any hint / link would be appreciated!
I just can’t Jay: I’m trying to help a friend deploying the app and can’t modify their server configuration. This is why I have to fix the nginx issue…
By the way, my understanding is:
Discourse is listening on ports 80/443.
nginx is playing the role of a switch, dispatching requests to different applications, base on their domain name:
netxcloud.mydomain.com trying to reach the port 80 → request is routed to server_IP:8000
crm.mydomain.com trying to reach the port 80 → request is routed to server_IP:9000
discourse.mydomain.com trying to reach the port 80 → request is routed to http://unix:/var/discourse/shared/standalone/nginx.http.sock: (hope the trailing colon is not a typo) as the setupo script has configured discourse to listen to this socket.
I’ll try to setup nginx again this afternoon. Can anyone confirm the exact syntax for the socket: http://unix:/var/discourse/shared/standalone/nginx.http.sock:? I want to make sure that the trailing colon is not a typo…
Indeed… I’ve applied in discourse.conf the modifications I proposed last Friday and Discourse now runs fine! At least I can reach the welcome page but I don’t receive the activation mail, which is not related to Discourse (I suspect my friend didn’t create the requested mail account ).
I owe you a warm thank you for the help you provided and hope I won’t come back on this forum too soon!
First thing I’ll check is that if forums@mydomain.com has been configured to send on behalf of noreply-forums@mydomain.com it needs to be checked at your email provider.
========================================
Discourse 2.9.0.beta9
Discourse version at forums.mydomain.com: Discourse 2.9.0.beta9
Discourse version at localhost: NOT FOUND
==================== DNS PROBLEM ====================
This server reports NOT FOUND, but forums.mydomain.com reports Discourse 2.9.0.beta9 .
This suggests that you have a DNS problem or that an intermediate proxy is to blame.
[...]
Testing sending to myprivatemail@yahoo.fr using ssl0.ovh.net:465, username:forums@mydomain.com with plain auth.
======================================== ERROR ========================================
UNEXPECTED ERROR
Net::ReadTimeout
====================================== SOLUTION =======================================
Could the mail issue be linked to the alleged DNS issue? I don’t have an “intermediate proxy”, just running nginx as the proxy web server…
No, my email provider (same as hosting provider) only allows port 465. By the way, I’ve read that I need to set SPF and DKIM record for the domain (is this subdomain?) and I didn’t set any of these yet: could this have any impact?
I’m browsing the post but I’ve forgotten some information:
The DNS is managed by our hosting provider (for some services), let’s say on ServerA.
Discourse is running on another server (ServerB) which is hosted by a different provider.
My understanding is then: Discourse on ServerB connects to the mail server on ServerA, authenticating with email/password to use the SMTP service provided by ServerA hosting provider.
Is this a abnormal config or may I still use the normal app.yml email config here?