netstat -tulpn shows that it is listening on these ports, but when trying to access, there is a timeout.
I found running on subfolder meta . discourse . org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507 which isn’t applicable
I found also meta . discourse . org/t/install-discourse-on-a-residential-internet-with-cloudflare-tunnel/211297
That goes in the right direction, but isn’t fully what I need.
PS Sorry for removing the links to forum, but I can’t post otherwise.
We don’t support running on non-standard ports. If the 80/443 ports are already occupied, you will need to use a separate server where they aren’t or run a reverse proxy to from your other services and Discourse.
The ports aren’t “occupied” in the usual way. Discourse can grab port 80 and 443 on that system, it is already running on a separate server on its own.
Im stuck at the step to disable the redirection/removing the port in the URL and everything would work as expected.
If you can’t publish on the standard ports, then it won’t work at all. Your choices here are to use a server where :80/443 are available, or to pick an alternative discussion platform.
Can you help me with the nginx reverse proxy configuration?
I’ve tried various options without success
server {
listen 20633 ssl;
server_name mydomain.com;
ssl_certificate /etc/letsencrypt/live/mensa.myftp.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mensa.myftp.org/privkey.pem;
location / {
# Remove the port from the proxy_pass URL using a regular expression
# The captured part of the regular expression ($1) will be replaced in the proxy_pass URL
# The actual backend server IP and port are specified separately in the proxy_pass directive
proxy_pass http://192.168.178.31:80/
#$request_uri;
proxy_redirect http://192.168.178.31:80/ $scheme://$host:20633/;
#return 301 $scheme://$host:$server_port/home;
#proxy_redirect http://192.168.178.31:20633 $scheme://$host:80;
# Preserve the Host header sent by the client to the backend server
#proxy_set_header Host $host;
proxy_set_header Host $http_host;
}
}
That tutorial is for running on the same server via unix socket. Is there also configuration for running the reverse proxy on a different system with different port? I think it should be since this case might occur more often. On the other host I already have a certificate.
Just to be clear: This setup is for testing only. In production it will run on port 443, but for development and testing a VM at home is completly sufficient and saves the cost for renting a server in the meantime.