git - drone - ghost - guacamole - rocket chat https://sigyl.com/
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 

466 lines
19 KiB

  1. ## Set a variable to help us decide if we need to add the
  2. ## 'Docker-Distribution-Api-Version' header.
  3. ## The registry always sets this header.
  4. ## In the case of nginx performing auth, the header is unset
  5. ## since nginx is auth-ing before proxying.
  6. map ${DOLLAR}upstream_http_docker_distribution_api_version ${DOLLAR}docker_distribution_api_version {
  7. '' 'registry/2.0';
  8. }
  9. server {
  10. # resolver 127.0.0.11 valid=30s; ## internal docker dns
  11. #listen [::]:3011 default ipv6only=on; ## listen for ipv6
  12. listen 80;
  13. client_header_timeout 120s;
  14. client_body_timeout 120s;
  15. client_max_body_size 200m;
  16. # save logs here
  17. server_name ${SERVER_NAME};
  18. location / {
  19. return 301 https://${DOLLAR}host${DOLLAR}request_uri;
  20. }
  21. }
  22. server {
  23. # resolver 127.0.0.11 valid=30s; ## internal docker dns
  24. #listen [::]:3011 default ipv6only=on; ## listen for ipv6
  25. # listen 444
  26. listen 5005 ssl;
  27. # this should allow large docs
  28. client_header_timeout 120s;
  29. client_body_timeout 120s;
  30. client_max_body_size 200m;
  31. ssl_certificate /etc/letsencrypt/live/${SERVER_NAME}/fullchain.pem;
  32. ssl_certificate_key /etc/letsencrypt/live/${SERVER_NAME}/privkey.pem;
  33. # save logs here
  34. #access_log /var/log/nginx/access.log compression;
  35. server_name ${SERVER_NAME};
  36. location ~ /(.*) {
  37. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  38. sub_filter '</head>' '<!-- Matomo -->
  39. <script type="text/javascript">
  40. var _paq = window._paq || [];
  41. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  42. _paq.push(["trackPageView"]);
  43. _paq.push(["enableLinkTracking"]);
  44. (function() {
  45. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  46. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  47. _paq.push(["setSiteId", "1"]);
  48. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  49. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  50. })();
  51. </script>
  52. <!-- End Matomo Code -->
  53. </head>';
  54. proxy_set_header Host ${DOLLAR}http_host;
  55. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  56. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  57. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  58. proxy_buffering off;
  59. set ${DOLLAR}upstream ${COMMENTO_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  60. proxy_pass ${DOLLAR}upstream;
  61. }
  62. }
  63. server {
  64. # resolver 127.0.0.11 valid=30s; ## internal docker dns
  65. #listen [::]:3011 default ipv6only=on; ## listen for ipv6
  66. # listen 444
  67. listen 5000 ssl;
  68. # this should allow large docs
  69. client_header_timeout 120s;
  70. client_body_timeout 120s;
  71. client_max_body_size 200m;
  72. ssl_certificate /etc/letsencrypt/live/${SERVER_NAME}/fullchain.pem;
  73. ssl_certificate_key /etc/letsencrypt/live/${SERVER_NAME}/privkey.pem;
  74. # save logs here
  75. #access_log /var/log/nginx/access.log compression;
  76. server_name ${SERVER_NAME};
  77. location ~ /(.*) {
  78. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  79. sub_filter '</head>' '<!-- Matomo -->
  80. <script type="text/javascript">
  81. var _paq = window._paq || [];
  82. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  83. _paq.push(["trackPageView"]);
  84. _paq.push(["enableLinkTracking"]);
  85. (function() {
  86. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  87. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  88. _paq.push(["setSiteId", "1"]);
  89. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  90. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  91. })();
  92. </script>
  93. <!-- End Matomo Code -->
  94. </head>';
  95. proxy_set_header Host ${DOLLAR}http_host;
  96. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  97. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  98. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  99. proxy_buffering off;
  100. set ${DOLLAR}upstream ${DRONE_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  101. proxy_pass ${DOLLAR}upstream;
  102. }
  103. }
  104. server {
  105. # resolver 127.0.0.11 valid=30s; ## internal docker dns
  106. #listen [::]:3011 default ipv6only=on; ## listen for ipv6
  107. # listen 444
  108. listen 5001 ssl;
  109. # this should allow large docs
  110. client_header_timeout 120s;
  111. client_body_timeout 120s;
  112. client_max_body_size 0;
  113. ssl_certificate /etc/letsencrypt/live/${SERVER_NAME}/fullchain.pem;
  114. ssl_certificate_key /etc/letsencrypt/live/${SERVER_NAME}/privkey.pem;
  115. # save logs here
  116. #access_log /var/log/nginx/access.log compression;
  117. # Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
  118. ssl_protocols TLSv1.1 TLSv1.2;
  119. ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  120. ssl_prefer_server_ciphers on;
  121. ssl_session_cache shared:SSL:10m;
  122. # required to avoid HTTP 411: see Issue #1486 (https://github.com/moby/moby/issues/1486)
  123. chunked_transfer_encoding on;
  124. server_name ${SERVER_NAME};
  125. location /v2/ {
  126. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  127. # Do not allow connections from docker 1.5 and earlier
  128. # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
  129. if (${DOLLAR}http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
  130. return 404;
  131. }
  132. add_header 'Docker-Distribution-Api-Version' ${DOLLAR}docker_distribution_api_version always;
  133. proxy_set_header Host ${DOLLAR}http_host;
  134. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  135. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  136. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  137. proxy_buffering off;
  138. #set ${DOLLAR}upstream ${REGISTRY_PROXY_PASS}/${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  139. proxy_pass ${REGISTRY_PROXY_PASS};
  140. }
  141. }
  142. server {
  143. # resolver 127.0.0.11 valid=30s; ## internal docker dns
  144. #listen [::]:3011 default ipv6only=on; ## listen for ipv6
  145. # listen 444
  146. listen 443 ssl;
  147. # this should allow large docs
  148. client_header_timeout 120s;
  149. client_body_timeout 120s;
  150. client_max_body_size 0;
  151. ssl_certificate /etc/letsencrypt/live/${SERVER_NAME}/fullchain.pem;
  152. ssl_certificate_key /etc/letsencrypt/live/${SERVER_NAME}/privkey.pem;
  153. # save logs here
  154. #access_log /var/log/nginx/access.log compression;
  155. # Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
  156. ssl_protocols TLSv1.1 TLSv1.2;
  157. ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  158. ssl_prefer_server_ciphers on;
  159. ssl_session_cache shared:SSL:10m;
  160. # required to avoid HTTP 411: see Issue #1486 (https://github.com/moby/moby/issues/1486)
  161. chunked_transfer_encoding on;
  162. server_name ${SERVER_NAME};
  163. location ~ ${GIT_LOCATION}(.*) {
  164. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  165. sub_filter '</head>' '<!-- Matomo -->
  166. <script type="text/javascript">
  167. var _paq = window._paq || [];
  168. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  169. _paq.push(["trackPageView"]);
  170. _paq.push(["enableLinkTracking"]);
  171. (function() {
  172. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  173. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  174. _paq.push(["setSiteId", "1"]);
  175. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  176. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  177. })();
  178. </script>
  179. <!-- End Matomo Code -->
  180. </head>';
  181. proxy_set_header Host ${DOLLAR}http_host;
  182. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  183. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  184. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  185. proxy_buffering off;
  186. set ${DOLLAR}upstream ${GIT_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  187. proxy_pass ${DOLLAR}upstream;
  188. }
  189. location ~ ${MATOMO_LOCATION}(.*) {
  190. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  191. sub_filter '</head>' '<!-- Matomo -->
  192. <script type="text/javascript">
  193. var _paq = window._paq || [];
  194. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  195. _paq.push(["trackPageView"]);
  196. _paq.push(["enableLinkTracking"]);
  197. (function() {
  198. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  199. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  200. _paq.push(["setSiteId", "1"]);
  201. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  202. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  203. })();
  204. </script>
  205. <!-- End Matomo Code -->
  206. </head>';
  207. set ${DOLLAR}upstream ${MATOMO_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  208. proxy_set_header Host ${DOLLAR}http_host;
  209. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  210. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  211. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  212. proxy_buffering off;
  213. proxy_pass ${DOLLAR}upstream;
  214. }
  215. location ~ ${PORTAINER_LOCATION}(.*) {
  216. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  217. sub_filter '</head>' '<!-- Matomo -->
  218. <script type="text/javascript">
  219. var _paq = window._paq || [];
  220. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  221. _paq.push(["trackPageView"]);
  222. _paq.push(["enableLinkTracking"]);
  223. (function() {
  224. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  225. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  226. _paq.push(["setSiteId", "1"]);
  227. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  228. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  229. })();
  230. </script>
  231. <!-- End Matomo Code -->
  232. </head>';
  233. set ${DOLLAR}upstream ${PORTAINER_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  234. proxy_set_header Host ${DOLLAR}http_host;
  235. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  236. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  237. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  238. proxy_buffering off;
  239. proxy_pass ${DOLLAR}upstream;
  240. }
  241. location ~ ${NAGIOS_LOCATION}(.*) {
  242. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  243. sub_filter '</head>' '<!-- Matomo -->
  244. <script type="text/javascript">
  245. var _paq = window._paq || [];
  246. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  247. _paq.push(["trackPageView"]);
  248. _paq.push(["enableLinkTracking"]);
  249. (function() {
  250. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  251. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  252. _paq.push(["setSiteId", "1"]);
  253. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  254. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  255. })();
  256. </script>
  257. <!-- End Matomo Code -->
  258. </head>';
  259. set ${DOLLAR}upstream ${NAGIOS_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  260. proxy_set_header Host ${DOLLAR}http_host;
  261. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  262. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  263. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  264. proxy_buffering off;
  265. proxy_pass ${DOLLAR}upstream;
  266. }
  267. location ~ ${ZABBIX_LOCATION}(.*) {
  268. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  269. sub_filter '</head>' '<!-- Matomo -->
  270. <script type="text/javascript">
  271. var _paq = window._paq || [];
  272. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  273. _paq.push(["trackPageView"]);
  274. _paq.push(["enableLinkTracking"]);
  275. (function() {
  276. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  277. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  278. _paq.push(["setSiteId", "1"]);
  279. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  280. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  281. })();
  282. </script>
  283. <!-- End Matomo Code -->
  284. </head>';
  285. set ${DOLLAR}upstream ${ZABBIX_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  286. proxy_set_header Host ${DOLLAR}http_host;
  287. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  288. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  289. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  290. proxy_buffering off;
  291. proxy_pass ${DOLLAR}upstream;
  292. }
  293. location ~ ${CHAT_LOCATION}sockjs(.*) {
  294. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  295. sub_filter '</head>' '<!-- Matomo -->
  296. <script type="text/javascript">
  297. var _paq = window._paq || [];
  298. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  299. _paq.push(["trackPageView"]);
  300. _paq.push(["enableLinkTracking"]);
  301. (function() {
  302. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  303. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  304. _paq.push(["setSiteId", "1"]);
  305. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  306. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  307. })();
  308. </script>
  309. <!-- End Matomo Code -->
  310. </head>';
  311. set ${DOLLAR}upstream ${CHAT_PROXY_PASS}chat/sockjs${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  312. proxy_pass ${DOLLAR}upstream;
  313. proxy_http_version 1.1;
  314. proxy_set_header Upgrade ${DOLLAR}http_upgrade;
  315. proxy_set_header Connection "Upgrade";
  316. proxy_set_header Host ${DOLLAR}host;
  317. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  318. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  319. proxy_set_header X-Forward-Proto http;
  320. proxy_set_header X-Nginx-Proxy true;
  321. proxy_redirect off;
  322. }
  323. location ~ ${CHAT_LOCATION}(.*) {
  324. sub_filter '</head>' '<!-- Matomo -->
  325. <script type="text/javascript">
  326. var _paq = window._paq || [];
  327. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  328. _paq.push(["trackPageView"]);
  329. _paq.push(["enableLinkTracking"]);
  330. (function() {
  331. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  332. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  333. _paq.push(["setSiteId", "1"]);
  334. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  335. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  336. })();
  337. </script>
  338. <!-- End Matomo Code -->
  339. </head>';
  340. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  341. set ${DOLLAR}upstream ${CHAT_PROXY_PASS}chat/${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  342. proxy_pass ${DOLLAR}upstream;
  343. }
  344. location ~ ${REMOTE_LOCATION}websocket-tunnel(.*) {
  345. sub_filter '</head>' '<!-- Matomo -->
  346. <script type="text/javascript">
  347. var _paq = window._paq || [];
  348. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  349. _paq.push(["trackPageView"]);
  350. _paq.push(["enableLinkTracking"]);
  351. (function() {
  352. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  353. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  354. _paq.push(["setSiteId", "1"]);
  355. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  356. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  357. })();
  358. </script>
  359. <!-- End Matomo Code -->
  360. </head>';
  361. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  362. set ${DOLLAR}upstream ${REMOTE_PROXY_PASS}websocket-tunnel${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  363. proxy_pass ${DOLLAR}upstream;
  364. proxy_http_version 1.1;
  365. proxy_set_header Upgrade ${DOLLAR}http_upgrade;
  366. proxy_set_header Connection "Upgrade";
  367. proxy_set_header Host ${DOLLAR}host;
  368. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  369. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  370. proxy_set_header X-Forward-Proto http;
  371. proxy_set_header X-Nginx-Proxy true;
  372. proxy_redirect off;
  373. }
  374. location ~ ${REMOTE_LOCATION}(.*) {
  375. sub_filter '</head>' '<!-- Matomo -->
  376. <script type="text/javascript">
  377. var _paq = window._paq || [];
  378. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  379. _paq.push(["trackPageView"]);
  380. _paq.push(["enableLinkTracking"]);
  381. (function() {
  382. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  383. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  384. _paq.push(["setSiteId", "1"]);
  385. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  386. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  387. })();
  388. </script>
  389. <!-- End Matomo Code -->
  390. </head>';
  391. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  392. set ${DOLLAR}upstream ${REMOTE_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  393. proxy_pass ${DOLLAR}upstream;
  394. }
  395. location ~ ${COMMENTO_LOCATION}(.*) {
  396. sub_filter '</head>' '<!-- Matomo -->
  397. <script type="text/javascript">
  398. var _paq = window._paq || [];
  399. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  400. _paq.push(["trackPageView"]);
  401. _paq.push(["enableLinkTracking"]);
  402. (function() {
  403. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  404. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  405. _paq.push(["setSiteId", "1"]);
  406. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  407. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  408. })();
  409. </script>
  410. <!-- End Matomo Code -->
  411. </head>';
  412. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  413. set ${DOLLAR}upstream ${COMMENTO_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  414. proxy_pass ${DOLLAR}upstream;
  415. }
  416. location ~ ${BLOG_LOCATION}(.*) {
  417. sub_filter '</head>' '<!-- Matomo -->
  418. <script type="text/javascript">
  419. var _paq = window._paq || [];
  420. /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  421. _paq.push(["trackPageView"]);
  422. _paq.push(["enableLinkTracking"]);
  423. (function() {
  424. var u="//${SERVER_NAME}${MATOMO_LOCATION}";
  425. _paq.push(["setTrackerUrl", u+"matomo.php"]);
  426. _paq.push(["setSiteId", "1"]);
  427. var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
  428. g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
  429. })();
  430. </script>
  431. <!-- End Matomo Code -->
  432. </head>';
  433. resolver 127.0.0.11 ipv6=off valid=30s; ## internal docker dns
  434. proxy_set_header Host ${DOLLAR}http_host;
  435. proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
  436. proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
  437. proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme;
  438. proxy_buffering off;
  439. set ${DOLLAR}upstream ${BLOG_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args;
  440. proxy_pass ${DOLLAR}upstream;
  441. }
  442. }