nginx-default.conf.j2 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. server {
  2. listen 80 default_server;
  3. listen [::]:80 default_server;
  4. # ssl
  5. listen 443 ssl;
  6. listen [::]:443 ssl;
  7. ssl_certificate {{mapserver_ssl_cert_path}};
  8. ssl_certificate_key {{mapserver_ssl_key_path}};
  9. ssl_dhparam /etc/nginx/dhparams.pem;
  10. server_name _;
  11. root /var/www;
  12. index index.html;
  13. location = / {
  14. return 302 /meshviewer/;
  15. }
  16. location /meshviewer {
  17. alias {{meshviewer_install_directory}};
  18. try_files $uri $uri/ =404;
  19. gzip on;
  20. gzip_comp_level 2;
  21. gzip_types application/json application/javascript text/css;
  22. gzip_vary on;
  23. }
  24. location /meshviewer-test {
  25. alias /srv/meshviewer-test;
  26. try_files $uri $uri/ =404;
  27. gzip on;
  28. gzip_comp_level 2;
  29. gzip_types application/json application/javascript text/css;
  30. gzip_vary on;
  31. }
  32. location /grafana {
  33. if ($scheme != "https") {
  34. rewrite ^ https://map.ffdo.de$request_uri permanent;
  35. }
  36. include proxy_params;
  37. proxy_pass http://127.0.0.1:3000/;
  38. rewrite ^/grafana/(.*) /$1 break;
  39. proxy_set_header Host $host;
  40. }
  41. location /data {
  42. alias /srv/ffmap-data;
  43. gzip on;
  44. gzip_comp_level 2;
  45. gzip_types application/json;
  46. gzip_vary on;
  47. }
  48. location /data-announced {
  49. proxy_pass http://127.0.0.1:{{gluon_collector_http_port}};
  50. proxy_redirect off;
  51. }
  52. # location /wiki {
  53. # if ($scheme = http){
  54. # rewrite ^ https://map.do.freifunk.ruhr$request_uri? permanent;
  55. # }
  56. # proxy_pass http://127.0.0.1:5001/;
  57. # proxy_set_header X-Real-IP $remote_addr;
  58. # proxy_redirect off;
  59. # }
  60. }