Skip to content

Instantly share code, notes, and snippets.

@serverok
Last active June 27, 2018 03:03
Show Gist options
  • Save serverok/cbb1f24d6f3f3b9b897345ca20efca0c to your computer and use it in GitHub Desktop.
Save serverok/cbb1f24d6f3f3b9b897345ca20efca0c to your computer and use it in GitHub Desktop.
server {
listen *:80;
server_name DOMAIN_NAME;
root /home/mediaftp/public_html/;
index ok.html index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# protect videos from direct access
location /contents/videos/ {
root /home/mediaftp/;
internal;
# enable MP4 streaming
location ~* .*\.mp4 {
mp4;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment