Advertisement
ustoopia

yourhostname.conf

Jul 16th, 2020 (edited)
844
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4.  
  5. server_name yourhostname;
  6.  
  7. root /var/www/yourhostname;
  8. index index.php index.html index-nginx.html index.htm;
  9.  
  10. add_header Strict-Transport-Security "max-age=63072000;";
  11. add_header X-Frame-Options "DENY";
  12.  
  13. location / {
  14. add_header Cache-Control no-cache;
  15. add_header Access-Control-Allow-Origin *;
  16. try_files $uri $uri/ =404;
  17. }
  18. location ~ \.php$ {
  19. include snippets/fastcgi-php.conf;
  20. fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
  21. # fastcgi_pass 127.0.0.1:9000;
  22. }
  23. location /stat {
  24. rtmp_stat all;
  25. rtmp_stat_stylesheet stat.xsl;
  26. #auth_basic Restricted Content;
  27. #auth_basic_user_file .htpasswd;
  28. }
  29. location /stat.xsl {
  30. root html;
  31. }
  32. location /control {
  33. rtmp_control all;
  34. #auth_basic stream;
  35. #auth_basic_user_file .htpasswd;
  36. }
  37. location ~ /\.ht {
  38. deny all;
  39. }
  40. location /hls {
  41. types {
  42. application/vnd.apple.mpegurl m3u8;
  43. video/mp2t ts;
  44. }
  45. autoindex on;
  46. alias /var/livestream/hls;
  47.  
  48. expires -1;
  49. add_header Strict-Transport-Security "max-age=63072000";
  50. add_header Cache-Control no-cache;
  51. add_header 'Access-Control-Allow-Origin' '*' always;
  52. add_header 'Access-Control-Expose-Headers' 'Content-Length';
  53. if ($request_method = 'OPTIONS') {
  54. add_header 'Access-Control-Allow-Origin' '*';
  55. add_header 'Access-Control-Max-Age' 1728000;
  56. add_header 'Content-Type' 'text/plain charset=UTF-8';
  57. add_header 'Content-Length' 0;
  58. return 204;
  59. }
  60. }
  61. location /dash {
  62. types{
  63. application/dash+xml mpd;
  64. video/mp4 mp4;
  65. }
  66. autoindex on;
  67. alias /var/livestream/dash;
  68.  
  69. add_header Strict-Transport-Security "max-age=63072000";
  70. add_header Cache-Control no-cache;
  71. expires -1;
  72. add_header 'Access-Control-Allow-Origin' '*' always;
  73. add_header 'Access-Control-Expose-Headers' 'Content-Length';
  74. if ($request_method = 'OPTIONS') {
  75. add_header 'Access-Control-Allow-Origin' '*';
  76. add_header 'Access-Control-Max-Age' 1728000;
  77. add_header 'Content-Type' 'text/plain charset=UTF-8';
  78. add_header 'Content-Length' 0;
  79. return 204;
  80. }
  81. }
  82. }
Advertisement
RAW Paste Data Copied
Advertisement