Subject: The mailing list for listmasters using Sympa
List archive
[sympa-users] Running Sympa with nginx + FastCGI. Config example
- From: Nikolay Shaplov <address@concealed>
- To: "address@concealed" <address@concealed>
- Subject: [sympa-users] Running Sympa with nginx + FastCGI. Config example
- Date: Tue, 31 Mar 2015 14:05:51 +0300
All examples of running sympa on nginx I found in the net, were not perfect.
For example they do not properly run on multihost instances.
I've tried to write a config that works for all my cases.
It was written for debian, on other systems some pathes might be different.
So here it goes!
====================
# based on https://gist.github.com/bjacint/7862912
server {
listen 80;
server_name *.*;
root /usr/lib/cgi-bin/sympa;
access_log /var/log/nginx/sympa.access.log;
error_log /var/log/nginx/sympa.error.log;
error_page 403 500 502 503 504 /50x.html;
rewrite ^/$ /wws permanent;
# While configuring sympa, you should specify wwsympa_url for each robot.
# if you do not do so, sympa will generate wwsympa_url as
${robot_name}/sympa.
# So to prevent non-active urls for robots without wwsympa_url, we do
this redirect:
rewrite ^/sympa/(.*)$ /wws/$1 permanent;
location ^~ /static-sympa/ {
alias /var/lib/sympa/static_content/;
access_log off;
}
location /50x.html {
root /usr/share/nginx/html;
}
location ~* \.(php|pl|py|jsp|asp|sh|cgi|bin|csh|ksh|out|run|o)$ {
deny all;
}
location ~ /\.ht {
deny all;
}
location /wws {
gzip off;
fastcgi_pass unix:/run/fcgiwrap.socket;
fastcgi_split_path_info ^(/wws)(.+)$;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
# According to RFC3875
(https://tools.ietf.org/html/rfc3875#section-4.1.14) in SERVER_NAME
# we should put an actual hostname user came to. For nginx it is in
$http_host
# This will allow to run sympa multihost instances
fastcgi_param SERVER_NAME $http_host;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param SCRIPT_FILENAME $document_root/wwsympa-wrapper.fcgi;
fastcgi_param HTTP_HOST $http_host;
fastcgi_intercept_errors on;
}
}
========================
I've also posted it into debian wiki: https://wiki.debian.org/Sympa/Nginx
If I find any problems, I will update it here. So follow the link for the
newest
version if you are reading this in mail archive :-)
Attachment:
signature.asc
Description: This is a digitally signed message part.
- [sympa-users] Running Sympa with nginx + FastCGI. Config example, Nikolay Shaplov, 03/31/2015
Archive powered by MHonArc 2.6.19+.