Skip to content

Instantly share code, notes, and snippets.

@iomarmochtar
Created July 21, 2017 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iomarmochtar/e780f4850e027a177cc1ea9e9c527aa9 to your computer and use it in GitHub Desktop.
Save iomarmochtar/e780f4850e027a177cc1ea9e9c527aa9 to your computer and use it in GitHub Desktop.
Nginx configuration file for mailman3_ei, listening on 80 (redirect to 443 https)
daemon off;
worker_processes 1;
user root;
error_log /opt/mailman3/var/logs/nginx-error.log;
pid /opt/mailman3/var/logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
upstream upstreams {
server localhost:8787 fail_timeout=0;
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
ssl_certificate /opt/mailman3/etc/nginx/certs/ssl.cert;
ssl_certificate_key /opt/mailman3/etc/nginx/certs/ssl.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
listen 443 default ssl;
error_page 497 https://$host:$server_port$request_uri;
client_max_body_size 4G;
access_log /opt/mailman3/var/logs/nginx-access.log;
location /static {
autoindex on;
alias /opt/mailman3/webui/webui/static/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_hide_header X-Powered-By;
if (!-f $request_filename) {
proxy_pass http://upstreams;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment