Created
January 27, 2020 16:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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