tddnetwork.org_nginx.conf 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. server {
  2. root /var/www/tddnetwork.org;
  3. index index.html index.htm index.nginx-debian.html;
  4. server_name tddnetwork.org www.tddnetwork.org;
  5. access_log /var/log/nginx/tddnetwork.org_access.log;
  6. error_log /var/log/nginx/tddnetwork.org_error.log;
  7. location / {
  8. # First attempt to serve request as file, then
  9. # as directory, then fall back to displaying a 404.
  10. autoindex on;
  11. autoindex_format html;
  12. autoindex_localtime on;
  13. try_files $uri $uri/ =404;
  14. }
  15. location ~* \.(?:png|mp4)$ {
  16. expires 1y;
  17. add_header Cache-Control "public";
  18. }
  19. location /auth {
  20. # First attempt to serve request as file, then
  21. # as directory, then fall back to displaying a 404.
  22. proxy_pass http://localhost:5000;
  23. proxy_http_version 1.1;
  24. proxy_set_header Upgrade $http_upgrade;
  25. proxy_set_header Connection 'upgrade';
  26. proxy_set_header Host $host;
  27. proxy_cache_bypass $http_upgrade;
  28. }
  29. # pass PHP scripts to FastCGI server
  30. #
  31. #location ~ \.php$ {
  32. # include snippets/fastcgi-php.conf;
  33. #
  34. # # With php-fpm (or other unix sockets):
  35. # fastcgi_pass unix:/run/php/php7.3-fpm.sock;
  36. # # With php-cgi (or other tcp sockets):
  37. # fastcgi_pass 127.0.0.1:9000;
  38. #}
  39. # deny access to .htaccess files, if Apache's document root
  40. # concurs with nginx's one
  41. #
  42. #location ~ /\.ht {
  43. # deny all;
  44. #}
  45. listen [::]:443 ssl; # managed by Certbot
  46. listen 443 ssl; # managed by Certbot
  47. ssl_certificate /etc/letsencrypt/live/tddnetwork.org/fullchain.pem; # managed by Certbot
  48. ssl_certificate_key /etc/letsencrypt/live/tddnetwork.org/privkey.pem; # managed by Certbot
  49. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  50. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  51. }
  52. server {
  53. if ($host = www.tddnetwork.org) {
  54. return 301 https://$host$request_uri;
  55. } # managed by Certbot
  56. if ($host = tddnetwork.org) {
  57. return 301 https://$host$request_uri;
  58. } # managed by Certbot
  59. listen 80;
  60. listen [::]:80;
  61. server_name tddnetwork.org www.tddnetwork.org;
  62. return 404; # managed by Certbot
  63. }