From 57a2ba636bc653cb5eca5f505ce5c8fdc3a5edac Mon Sep 17 00:00:00 2001 From: tianyu Date: Thu, 23 Jul 2015 10:26:12 +0800 Subject: [PATCH] Update nginx.config.remote.example --- net/youtube/nginx.config.remote.example | 59 ++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/net/youtube/nginx.config.remote.example b/net/youtube/nginx.config.remote.example index a7f3f2e..8182371 100644 --- a/net/youtube/nginx.config.remote.example +++ b/net/youtube/nginx.config.remote.example @@ -1,9 +1,54 @@ -location /path/to/youtube.php { - auth_basic "Authentication required"; - auth_basic_user_file /etc/nginx/.dlpasswd; -} +server { + listen 80; + listen 443 ssl; + server_name remote.example.com; + ssl_certificate certs/remote.example.com.chained.crt; + ssl_certificate_key certs/remote.example.com.key; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + + charset utf-8; + + access_log/var/log/nginx/$host.access.log; + + client_max_body_size 20M; + + root /var/www/; + indexindex.html index.htm index.php; + + if ($ssl_protocol = "") { + return 302 https://$http_host$request_uri; + } + + location / { + try_files $uri $uri/ /index.php?q=$uri&$args; + } + + #error_page404/404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504/50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } -location /path/to/rm.php { - auth_basic "Authentication required"; - auth_basic_user_file /etc/nginx/.dlpasswd; + location /downloads { + alias /home/downloads; + auth_basic "Authentication required"; + auth_basic_user_file /etc/nginx/.dlpasswd; + autoindex on; + autoindex_exact_size off; + } + + location /path/to/youtube.php { + auth_basic "Authentication required"; + auth_basic_user_file /etc/nginx/.dlpasswd; + } + + location /path/to/rm.php { + auth_basic "Authentication required"; + auth_basic_user_file /etc/nginx/.dlpasswd; + } }