Advertisement
ustoopia

your.hostname.com.vhost

Aug 3rd, 2023 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | Source Code | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. root /var/www/web;
  5. server_name your.hostname.com www.your.hostname.com; # <<== EDIT THIS
  6.  
  7. index index.php index.html index.htm index.cgi index.pl index.xhtml standard_index.html;
  8.  
  9. location ~ /\. {
  10. deny all;
  11. }
  12. location / {
  13. try_files $uri $uri/ /index.php?$args;
  14. }
  15. location ~ \.php$ {
  16. include snippets/fastcgi-php.conf;
  17. include /etc/nginx/fastcgi_params;
  18. fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
  19. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  20. fastcgi_intercept_errors on;
  21. }
  22. location /stat {
  23. rtmp_stat all;
  24. rtmp_stat_stylesheet stat.xsl;
  25. add_header Refresh "8; $request_uri"; # Refreshes the stat page every 5 seconds.
  26. # auth_basic "Members Only"; # Create a valid .htpasswd before uncommenting this.
  27. # auth_basic_user_file /var/www/web/.htpasswd; # Create a valid .htpasswd before uncommenting this.
  28. }
  29. location /stat.xsl {
  30. root /var/www/web;
  31. }
  32. location /control {
  33. rtmp_control all;
  34. }
  35. location /keys {
  36. root /mnt/livestream;
  37. autoindex off;
  38. }
  39. location /nginx_status {
  40. stub_status on;
  41. allow 127.0.0.1;
  42. }
  43. location /hls {
  44. alias /mnt/livestream/hls; # Points to where the video fragment files are located
  45. autoindex on; # Optional. Allow browsing of the video fragment files folder
  46. expires -1; # Cache related
  47. add_header Cache-Control no-cache; # Prevent caching of HLS fragments
  48. add_header Access-Control-Allow-Origin *; # Allow remote web players to access our playlist
  49. types {
  50. application/vnd.apple.mpegurl m3u8;
  51. text/html html;
  52. video/mp2t ts;
  53. }
  54. if ($request_method = 'OPTIONS') {
  55. add_header 'Access-Control-Allow-Origin' '*';
  56. add_header 'Content-Length' 0;
  57. return 204;
  58. }
  59. }
  60. location /dash {
  61. alias /mnt/livestream/dash;
  62. autoindex on;
  63. expires -1;
  64. add_header Cache-Control no-cache; # Prevent caching of HLS fragments
  65. add_header Access-Control-Allow-Origin *; # Allow remote web player to access our playlist
  66. types {
  67. application/dash+xml mpd;
  68. text/html html;
  69. video/mp4 mp4;
  70. }
  71. if ($request_method = 'OPTIONS') {
  72. add_header 'Access-Control-Allow-Origin' '*';
  73. add_header 'Content-Length' 0;
  74. return 204;
  75. }
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement