Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.5 KiB

  1. # based on https://gist.github.com/bjacint/7862912
  2. server {
  3. listen 80;
  4. server_name *.*;
  5. root /usr/lib/cgi-bin/sympa;
  6. access_log /var/log/nginx/sympa.access.log;
  7. error_log /var/log/nginx/sympa.error.log;
  8. error_page 403 500 502 503 504 /50x.html;
  9. rewrite ^/$ /wws permanent;
  10. # While configuring sympa, you should specify wwsympa_url for each robot.
  11. # if you do not do so, sympa will generate wwsympa_url as ${robot_name}/sympa.
  12. # So to prevent non-active urls for robots without wwsympa_url, we do this redirect:
  13. rewrite ^/sympa/(.*)$ /wws/$1 permanent;
  14. location ^~ /static-sympa/ {
  15. alias /var/lib/sympa/static_content/;
  16. access_log off;
  17. }
  18. location /50x.html {
  19. root /usr/share/nginx/html;
  20. }
  21. location ~* \.(php|pl|py|jsp|asp|sh|cgi|bin|csh|ksh|out|run|o)$ {
  22. deny all;
  23. }
  24. location ~ /\.ht {
  25. deny all;
  26. }
  27. location /wws {
  28. gzip off;
  29. fastcgi_pass unix:/run/fcgiwrap.socket;
  30. fastcgi_split_path_info ^(/wws)(.+)$;
  31. fastcgi_param QUERY_STRING $query_string;
  32. fastcgi_param REQUEST_METHOD $request_method;
  33. fastcgi_param CONTENT_TYPE $content_type;
  34. fastcgi_param CONTENT_LENGTH $content_length;
  35. fastcgi_param PATH_INFO $fastcgi_path_info;
  36. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  37. fastcgi_param REQUEST_URI $request_uri;
  38. fastcgi_param DOCUMENT_URI $document_uri;
  39. fastcgi_param DOCUMENT_ROOT $document_root;
  40. fastcgi_param SERVER_PROTOCOL $server_protocol;
  41. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  42. fastcgi_param SERVER_SOFTWARE nginx;
  43. fastcgi_param REMOTE_ADDR $remote_addr;
  44. fastcgi_param REMOTE_PORT $remote_port;
  45. fastcgi_param SERVER_ADDR $server_addr;
  46. fastcgi_param SERVER_PORT $server_port;
  47. # According to RFC3875 (https://tools.ietf.org/html/rfc3875#section-4.1.14) in SERVER_NAME
  48. # we should put an actual hostname user came to. For nginx it is in $host
  49. # This will allow to run sympa multihost instances
  50. fastcgi_param SERVER_NAME $host;
  51. fastcgi_param REMOTE_USER $remote_user;
  52. fastcgi_param SCRIPT_FILENAME $document_root/wwsympa-wrapper.fcgi;
  53. fastcgi_param HTTP_HOST $http_host;
  54. fastcgi_intercept_errors on;
  55. }
  56. }