Last active
June 27, 2018 03:03
-
-
Save serverok/cbb1f24d6f3f3b9b897345ca20efca0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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