To make mailman open a unix socket for the web server I had to change the file:
/opt/mailman/build/main.js
where it was:
const server = app.listen(port, process.env.MAILMAN_HOST || "0.0.0.0", () => console.log("Mailman is running on http://%s:%d%s in %s mode", server.address().address, server.address().port, base, "production"));
I made:
var server;if (process.env.MAILMAN_SOCKET) {var fs = require('fs');server = app.listen(process.env.MAILMAN_SOCKET, () => console.log("Mailman is running on socket %s in %s mode", process.env.MAILMAN_SOCKET, "production"), () => fs.chmodSync(process.env.MAILMAN_SOCKET, '666'));} else {server = app.listen(port, process.env.MAILMAN_HOST || "0.0.0.0", () => console.log("Mailman is running on http://%s:%d%s in %s mode", server.address().address, server.address().port, base, "production"));}
In /opt/mailman/.env define:
MAILMAN_SOCKET=/path/to/socket
In nginx the configuration include:
proxy_pass http://unix:/path/to/socket:$uri$is_args$args;
To make mailman open a unix socket for the web server I had to change the file: /opt/mailman/build/main.js
where it was:
const server = app.listen(port, process.env.MAILMAN_HOST || "0.0.0.0", () => console.log("Mailman is running on http://%s:%d%s in %s mode", server.address().address, server.address().port, base, "production"));
I made:
var server;
if (process.env.MAILMAN_SOCKET) {
var fs = require('fs');
server = app.listen(process.env.MAILMAN_SOCKET, () => console.log("Mailman is running on socket %s in %s mode", process.env.MAILMAN_SOCKET, "production"), () => fs.chmodSync(process.env.MAILMAN_SOCKET, '666'));
} else {
server = app.listen(port, process.env.MAILMAN_HOST || "0.0.0.0", () => console.log("Mailman is running on http://%s:%d%s in %s mode", server.address().address, server.address().port, base, "production"));
}
In /opt/mailman/.env define:
MAILMAN_SOCKET=/path/to/socket
In nginx the configuration include:
proxy_pass http://unix:/path/to/socket:$uri$is_args$args;