server { listen 80; #listen [::]:80; server_name mv.loveud.com; index index.html index.htm index.php default.html default.htm default.php; root /web/mv; include other.conf; #error_page 404 /404.html; # Add headers to serve security related headers # Before enabling Strict-Transport-Security headers please read into this topic first. add_header Strict-Transport-Security "max-age=15552000; includeSubDomains"; add_header X-Content-Type-Options nosniff; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; # set max upload size client_max_body_size 2G; fastcgi_buffers 64 4K; include enable-php.conf; #youPHPtube .htaccess #main Files location / { rewrite ^/$ /view/ last; } location /bootstrap { rewrite ^/bootstrap/(.+)$ /view/bootstrap/$1 last; } location /js { rewrite ^/js/(.+)$ /view/js/$1 last; } location /css { rewrite ^/css/(.+)$ /view/css/$1 last; } location /img { rewrite ^/img/(.+)$ /view/img/$1 last; } location /page { rewrite ^/page/([0-9]+)/?$ /view/?page=$1 last; } location /videoOnly { rewrite ^/videoOnly/?$ /view/?type=video last; } location /audioOnly { rewrite ^/audioOnly/?$ /view/?type=audio last; } #manager playList location /channel { rewrite ^/channel/([0-9]+)/?$ /view/channel.php?user_id=$1 last; } location = /channel/ { rewrite ^/channel/?$ /view/channel.php last; } location = /channel { rewrite ^(.*)?$ /view/channel.php last; } location = /playLists.json { rewrite ^/playLists.json$ /objects/playlists.json.php last; } location = /download { rewrite ^(.*)$ /view/downloadExternalVideo.php last; } location = /downloadNow { rewrite ^(.*)$ /objects/downloadVideo.php last; } location = /getDownloadProgress { rewrite ^(.*)$ /objects/downloadVideoProgress.php last; } location = /about { rewrite ^(.*)$ /view/about.php last; } location = /contact { rewrite ^(.*)$ /view/contact.php last; } location = /sendEmail { rewrite ^(.*)$ /objects/sendEmail.json.php last; } location = /captcha { rewrite ^(.*)$ /objects/getCaptcha.php last; } location ~ /monitor { rewrite ^/monitor/(.+)$ /objects/ServerMonitor/$1 last; } #for the category name location /cat { rewrite ^/cat/([A-Za-z0-9-]+)/video/([A-Za-z0-9-_.]+)/?$ /view/?catName=$1&videoName=$2; rewrite ^/cat/([A-Za-z0-9-]+)/?$ /view/?catName=$1 last; } #for the video name location /video { #rewrite ^/video/([A-Za-z0-9-_.]+)/page/([0-9]+)/??$ /view/?videoName=$1&page=$2; #mi rewrite ^/video/([A-Za-z0-9-_.]+)/?$ /view/?videoName=$1 last; } #for the embeded video name location /videoEmbeded { rewrite ^/videoEmbeded/([A-Za-z0-9-_.]+)/?$ /view/videoEmbeded.php?videoName=$1 last; } location = /upload { rewrite ^(.*)$ /view/mini-upload-form/ last; } location = /fileUpload { rewrite ^(.*)$ /view/mini-upload-form/upload.php last; } location /uploadStatu { rewrite ^/uploadStatus /view/mini-upload-form/videoConversionStatus.php last; } location = /user { rewrite ^(.*)$ /view/user.php last; } location = /users { rewrite ^(.*)$ /view/managerUsers.php last; } location = /users.json { rewrite ^(.*)$ /objects/users.json.php last; } location = /updateUser { rewrite ^(.*)$ /objects/userUpdate.json.php last; } location = /savePhoto { rewrite ^(.*)$ /objects/userSavePhoto.php last; } location = /saveBackground { rewrite ^(.*)$ /objects/userSaveBackground.php last; } location = /addNewUser { rewrite ^(.*)$ /objects/userAddNew.json.php last; } location = /deleteUser { rewrite ^(.*)$ /objects/userDelete.json.php last; } location = /recoverPass { rewrite ^(.*)$ /objects/userRecoverPass.php last; } location = /saveRecoverPassword { rewrite ^(.*)$ /objects/userRecoverPassSave.json.php last; } location = /signUp { rewrite ^(.*)$ /view/signUp.php last; } location = /createUser { rewrite ^(.*)$ /objects/userCreate.json.php last; } location = /usersGroups { rewrite ^(.*)$ /view/managerUsersGroups.php last; } location = /usersGroups.json { rewrite ^(.*)$ /objects/usersGroups.json.php last; } location = /addNewUserGroups { rewrite ^(.*)$ /objects/userGroupsAddNew.json.php last; } location = /deleteUserGroups { rewrite ^(.*)$ /objects/userGroupsDelete.json.php last; } location = /ads { rewrite ^(.*)$ /view/managerAds.php last; } location = /addNewAd { rewrite ^(.*)$ /objects/video_adsAddNew.json.php last; } location = /ads.json { rewrite ^(.*)$ /objects/video_ads.json.php last; } location = /deleteVideoAd { rewrite ^(.*)$ /objects/video_adDelete.json.php last; } location /adClickLo { rewrite ^/adClickLog /objects/video_adClickLog.php last; } location = /categories { rewrite ^(.*)$ /view/managerCategories.php last; } location = /categories.json { rewrite ^(.*)$ /objects/categories.json.php last; } location = /addNewCategory { rewrite ^(.*)$ /objects/categoryAddNew.json.php last; } location = /deleteCategory { rewrite ^(.*)$ /objects/categoryDelete.json.php last; } # Subscribes location = /subscribes { rewrite ^subscribes$ /view/managerSubscribes.php last; } location = /subscribes.json { rewrite ^subscribes.json$ /objects/subscribes.json.php last; } location = /subscribe.json { rewrite ^subscribe.json$ /objects/subscribe.json.php last; } location = /notifySubscribers.json { rewrite ^notifySubscribers.json$ /objects/notifySubscribers.json.php last; } location = /orphanFiles { rewrite ^(.*)$ /view/orphanFiles.php last; } location = /mvideos { rewrite ^(.*)$ /view/managerVideos.php last; } location = /videos.json { rewrite ^(.*)$ /objects/videos.json.php last; } location = /deleteVideo { rewrite ^(.*)$ /objects/videoDelete.json.php last; } location = /addNewVideo { rewrite ^(.*)$ /objects/videoAddNew.json.php last; } location = /refreshVideo { rewrite ^(.*)$ /objects/videoRefresh.json.php last; } location = /setStatusVideo { rewrite ^(.*)$ /objects/videoStatus.json.php last; } location = /reencodeVideo { rewrite ^(.*)$ /objects/videoReencode.json.php last; } location = /addViewCountVideo { rewrite ^(.*)$ /objects/videoAddViewCount.json.php last; } location = /saveComment { rewrite ^(.*)$ /objects/commentAddNew.json.php last; } location /comments { rewrite ^/comments.json/([0-9]+)$ /objects/comments.json.php?video_id=$1 last; } location = /login { rewrite ^(.*)$ /objects/login.json.php last; } location = /logoff { rewrite ^(.*)$ /objects/logoff.php last; } location = /like { rewrite ^(.*)$ /objects/like.json.php?like=1 last; } location = /dislike { rewrite ^(.*)$ /objects/like.json.php?like=-1 last; } location /update { rewrite ^/update/?$ /update/update.php last; } location = /siteConfigurations { rewrite ^(.*)$ /view/configurations.php last; } location = /updateConfig { rewrite ^(.*)$ /objects/configurationUpdate.json.php last; } location = /charts { rewrite ^(.*)$ /view/charts.php last; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REQUEST_URI $uri?$args; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; #fastcgi_pass php-handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; #Available since nginx 1.7.11 } access_log /home/wwwlogs/mv.loveud.com.log; }