Yes. The sockets are available outside of the container.
I am using OpenResty, which is running in a container. Do I just need to mount the /var/discourse/shared/standalone directory, where the nginx.http.sock file is stored, into the container?
That’s brilliant! This should be the actual “installation guide” and not the page that is currently written as “official”! Thousand thanks!
A question:
Is the socket template (with nginx.http.sock in the conf file) a must if I want to setup other websites running on the same standalone server along with discourse?
We’ve recently migrated server and we ended up using port 8080 and nginx as reverse proxy but without using the socket template. Since it is working ok and I don’t see the point of using that method I would like to know if there’s no other way.
If the port works for you then you don’t need the socket. Some people like the socket better for Reasons, but it doesn’t matter much.
This was easy and worked for me. I used port 8080. I am using nginx and since I want to expose the app (along with all my other apps) on port 80 on my host machine, I just added this config file to the sites-available (and symbolically linked to sites-enabled):
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Can u share caddy configuration ?