Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
YouPHPTube Streamer NginX Conf
server {
listen 80;
server_name <domain> <www.domain>;
root /var/www;
index index.php;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
client_max_body_size 2G;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log combined;
# 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;
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_read_timeout 120;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_param HTTPS on;
fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
fastcgi_param front_controller_active true;
fastcgi_request_buffering off;
}
location = /index.php {
rewrite ^(.*)$ /view/index.php 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;
}
location = /download {
rewrite ^(.*)$ /view/downloadExternalVideo.php last;
}
location = /info {
rewrite ^(.*)$ /view/info.php last;
}
location = /downloadNow {
rewrite ^(.*)$ /objects/downloadVideo.php last;
}
location = /getDownloadProgress {
rewrite ^(.*)$ /objects/downloadVideoProgress.php last;
}
location = /status {
rewrite ^(.*)$ /objects/status.json.php last;
add_header Access-Control-Allow-Origin https://encoder.videoz.ca;
}
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;
}
location = /videosList {
rewrite ^(.*)$ /view/videosList.php last;
}
location /videosList {
rewrite ^/videosList/video/([A-Za-z0-9-_.]+)/page/([0-9]+)/?$ /view/videosList.php?videoName=$1&page=$2 last;
rewrite ^/videosList/cat/([A-Za-z0-9-]+)/video/([A-Za-z0-9-_.]+)/page/([0-9]+)/?$ /view/videosList.php?catName=$1&videoName=$2&page=$3 last;
}
location /cat {
rewrite ^/cat/([A-Za-z0-9-]+)/?$ /view/?catName=$1 last;
rewrite ^/cat/([A-Za-z0-9-]+)/page/([0-9]+)/?$ /view/?catName=$1&page=$2 last;
rewrite ^/cat/([A-Za-z0-9-]+)/video/([A-Za-z0-9-_.]+)/?$ /view/?catName=$1&videoName=$2 last;
rewrite ^/cat/([A-Za-z0-9-]+)/video/([A-Za-z0-9-_.]+)/page/([0-9]+)/?$ /view/?catName=$1&videoName=$2&page=$3 last;
}
location /video {
rewrite ^/video/([A-Za-z0-9-_.]+)/?$ /view/?videoName=$1 last;
rewrite ^/video/([A-Za-z0-9-_.]+)/page/([0-9]+)/??$ /view/?videoName=$1&page=$2 last;
}
location /v {
rewrite ^/v/([0-9]+)/?$ /view/?v=$1 last;
}
location /videoEmbeded {
rewrite ^/videoEmbeded/([A-Za-z0-9-_.]+)/?$ /view/videoEmbeded.php?videoName=$1 last;
}
location /videoEmbed {
rewrite ^/videoEmbed/([A-Za-z0-9-_.]+)/?$ /view/videoEmbeded.php?videoName=$1 last;
}
location /vEmbed {
rewrite ^/vEmbed/([0-9]+)/?$ /view/videoEmbeded.php?v=$1 last;
}
location = /upload {
rewrite ^(.*)$ /view/mini-upload-form/ last;
}
location = /fileUpload {
rewrite ^(.*)$ /view/mini-upload-form/upload.php last;
}
location /uploadPoster {
rewrite ^/uploadPoster/([0-9]+)/(jpg|gif)$ /objects/uploadPoster.php?video_id=$1&type=$2 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;
}
location = /plugins {
rewrite ^(.*)$ /view/managerPlugins.php last;
}
location = /plugins.json {
rewrite ^(.*)$ /objects/plugins.json.php last;
}
location = /pluginsAvailable.json {
rewrite ^(.*)$ /objects/pluginsAvailable.json.php last;
}
location = /pluginImport.json {
rewrite ^(.*)$ /objects/pluginImport.json.php last;
}
location = /switchPlugin {
rewrite ^(.*)$ /objects/pluginSwitch.json.php last;
}
location = /addDataObjectPlugin.json {
rewrite ^(.*)$ /objects/pluginAddDataObject.json.php last;
}
location = /runDBScriptPlugin.json {
rewrite ^(.*)$ /objects/pluginRunDatabaseScript.json.php last;
}
location = /playLists.json {
rewrite ^(.*)$ /objects/playlists.json.php last;
}
location = /playListsVideos.json {
rewrite ^(.*)$ /objects/playlistsVideos.json.php last;
}
location /playListsFromUser {
rewrite ^/playListsFromUser.json/([0-9]+)/?$ /objects/playlistsFromUser.json.php?users_id=$1 last;
}
location = /addNewPlayList {
rewrite ^(.*)$ /objects/playlistAddNew.json.php last;
}
location = /playListAddVideo.json {
rewrite ^(.*)$ /objects/playListAddVideo.json.php last;
}
location /playlist {
rewrite ^/playlist/([0-9]+)/([0-9]+)/?$ /view/?playlist_id=$1&playlist_index=$2 last;
rewrite ^/playlist/([0-9]+)/?$ /view/?playlist_id=$1 last;
}
location /removeVideoFromPlaylist {
rewrite ^/removeVideoFromPlaylist/?$ /objects/playlistRemoveVideo.php last;
}
location /removePlaylist {
rewrite ^/removePlaylist/?$ /objects/playlistRemove.php last;
}
location /renamePlaylist {
rewrite ^/renamePlaylist/?$ /objects/playlistRename.php last;
}
location /sortPlaylist {
rewrite ^/sortPlaylist/?$ /objects/playlistSort.php last;
}
location /channel {
rewrite ^/channel/([^/]+)/?$ /view/channel.php?channelName=$1 last;
rewrite ^/channel/?$ /view/channel.php last;
}
location /channels {
rewrite ^/channels/?$ /view/channels.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 = /videosAndroid.json {
rewrite ^(.*)$ /objects/videosAndroid.json.php last;
}
location = /videoAndroid.json {
rewrite ^(.*)$ /objects/videoAndroid.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 = /setCategoryVideo {
rewrite ^(.*)$ /objects/videoCategory.json.php last;
}
location = /reencodeVideo {
rewrite ^(.*)$ /objects/videoReencode.json.php last;
}
location = /rotateVideo {
rewrite ^(.*)$ /objects/videoRotate.json.php last;
}
location = /addViewCountVideo {
rewrite ^(.*)$ /objects/videoAddViewCount.json.php last;
}
location = /subscribes {
rewrite ^(.*)$ /view/managerSubscribes.php last;
}
location = /subscribes.json {
rewrite ^(.*)$ /objects/subscribes.json.php last;
}
location = /subscribe.json {
rewrite ^(.*)$ /objects/subscribe.json.php last;
}
location = /notifySubscribers.json {
rewrite ^(.*)$ /objects/notifySubscribers.json.php last;
}
location = /youPHPTubeQueueEncoder.json {
rewrite ^(.*)$ /objects/youPHPTubeQueueEncoder.json.php last;
}
location = /youPHPTubeEncoder.json {
rewrite ^(.*)$ /objects/youPHPTubeEncoder.json.php last;
}
location = /comments {
rewrite ^(.*)$ /view/managerComments.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 = /youtubeUpload {
rewrite ^(.*)$ /objects/youtubeUpload.json.php last;
}
location = /googleAdView {
rewrite ^(.*)$ /view/googleAdView.php last;
}
location = /notifications.json {
rewrite ^(.*)$ /objects/notifications.json.php last;
}
#location /videos {
# rewrite ^/videos/([A-Za-z0-9-_.]+)$ /view/xsendfile.php?file=$1 last;
#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.