delyan
August 28, 2024, 5:49am
1
Double nginx idea: Run other websites on the same machine as Discourse - #269 by sam - Self-Hosting - Discourse Meta
add the nginx stream module: unknown directive "stream" in /etc/nginx/nginx.conf:86 - Server Fault
Configure discourse: edit /var/discourse/containers/app.yml
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
- "3001:80" # http
- "3002:443" # https
Edit /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
stream {
upstream backend {
server 127.0.0.1:3002;
}
server {
listen 443;
proxy_pass backend;
}
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
}