Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created January 27, 2020 16:31
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 eksiscloud/fc7ab0b60dff4f5bda42404cde6cd249 to your computer and use it in GitHub Desktop.
Save eksiscloud/fc7ab0b60dff4f5bda42404cde6cd249 to your computer and use it in GitHub Desktop.
A Live example of Matomo nginx virtua host in stack Nginx/Varnish/Apache2
server {
listen 46.101.98.116:443 ssl http2;
server_name stats.eksis.eu;
access_log /var/log/nginx/access.matomo.log;
error_log /var/log/nginx/error.matomo.log;
location / {
proxy_pass http://127.0.0.1:8080;
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 https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
proxy_pass_header Server;
}
ssl_certificate /etc/letsencrypt/live/stats.eksis.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/stats.eksis.eu/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
listen 46.101.98.116:80;
server_name stats.eksis.eu;
access_log /var/log/nginx/access-80.log;
error_log /var/log/nginx/error-80.log;
return 301 https://$host$request_uri;
return 404;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment