rob70 Posted January 5, 2023 Share Posted January 5, 2023 I see the nginx file in the _INSTALL folder, but it doesn't look like it's in the same format as my existing nginx.conf files. Do you have a sample file that I can use that looks like this? Is mine old? Is yours? Mine look like this: server { server_name <my.url.com>; root /usr/share/nginx/html/<my.url.com>; index index.php index.html index.htm; client_max_body_size 200M; location / { try_files $uri $uri/ /index.php?$args; #try_files $uri $uri/ =404; } a quick adaptation of yours returns the following nginx -t nginx: [emerg] "location" directive is not allowed here in /etc/nginx/conf.d/some-conf-file.conf:42 nginx: configuration file /etc/nginx/nginx.conf test failed Quote Link to comment Share on other sites More sharing options...
Tech Support Posted January 5, 2023 Share Posted January 5, 2023 There is no standard nginx.conf file, as most of them are generated by server panels and have their own formatting. If your server doesn't have any panel, you can simply take the template of default config provided by your nginx installation. The nginx_config.txt file provided with theme archive is a list of URL rewrites in nginx syntax, in case you are not planning to use Apache. By default KVS requires Apache + mod_rewrite, so that URL rewrites are working via .htaccess file. But some clients opt to use pure nginx + php-fpm, in this case they will need URL rewrites being put directly into nginx config, and they can take rewrites from this file. Quote Link to comment Share on other sites More sharing options...
Tanjiro Posted January 6, 2023 Share Posted January 6, 2023 KVS lacks of a lot question from members/costumers, some may be experts but a lot are newbies, fresh start don't know how to install, they need step by step guide, I have so much questions to ask, tried to find questions from members but I don't see no one, already read https://www.kernel-scripts.com/en/documentation/kvs_settings but not enough details for newbies Quote Link to comment Share on other sites More sharing options...
Tanjiro Posted January 6, 2023 Share Posted January 6, 2023 Btw, here is my conf file (i'm running ubuntu 20.04 and using nginx) server { listen 80; server_name mysite.com www.mysite.com; rewrite ^(.*) https://mysite.com$1 permanent; } server { listen 80 default_server; # access_log off; access_log /var/www/logs/access.log; # error_log off; error_log /var/www/logs/error.log; root /var/www/public_html; index index.php index.html index.htm; server_name mysite.com; location / { try_files $uri $uri/ /index.php?$args; } # this code is from kvs nginx_config.txt in install folder # protection for non-public directories location ~* /contents/.*\.php$ { internal; } location /admin/data/ { internal; } location /admin/logs/ { internal; } location /admin/plugins/ { internal; } location /admin/smarty/ { internal; } location /admin/stamp/ { internal; } location /admin/template/ { internal; } location /admin/tools/ { internal; } location /blocks/ { internal; } location /template/ { internal; } location /tmp/ { internal; } location /langs/ { internal; } # admin panel rewrites rewrite ^/admin/posts_for_(.*)\.php$ /admin/posts_for_types.php?post_type_external_id=$1 last; rewrite ^/admin/feeds/(.*)/$ /admin/feeds/get_feed.php?external_id=$1 last; rewrite ^/admin/api/b935e966e33d5107a78faadb1849a0cd\.php$ /admin/api/kvs_api.php last; rewrite ^/admin/billings/([^/]*)/b935e966e33d5107a78faadb1849a0cd\.php$ /admin/billings/$1/$1.php last; # global --------------------------------------------------------------------------------------------------------------- rewrite ^/terms/$ /terms.php last; rewrite ^/dmca/$ /dmca.php last; rewrite ^/2257/$ /2257.php last; rewrite ^/search/([^/]+)/$ /search.php?q=$1 last; rewrite ^/search/$ /search.php last; rewrite ^/link/([^/]+)/$ /redirect_cs.php?dir=$1 last; rewrite ^/random_video(/)?$ /redirect_random_video.php last; rewrite ^/random_album(/)?$ /redirect_random_album.php last; # posts example -------------------------------------------------------------------------------------------------------- rewrite ^/news/$ /posts_list.php?post_type=news last; rewrite ^/news/([0-9]+)/$ /posts_list.php?post_type=news&from=$1 last; rewrite ^/news/([0-9]+)/([^/]+)/$ /view_post.php?id=$1&dir=$2 last; rewrite ^/news/([^/]+)/$ /view_post.php?dir=$1 last; # videos --------------------------------------------------------------------------------------------------------------- rewrite ^/latest-updates/([0-9]+)/$ /videos_list_latest.php?from=$1 last; rewrite ^/latest-updates/$ /videos_list_latest.php last; rewrite ^/top-rated/([0-9]+)/$ /videos_list.php?sort_by=rating&from=$1 last; rewrite ^/top-rated/$ /videos_list.php?sort_by=rating last; rewrite ^/most-popular/([0-9]+)/$ /videos_list.php?sort_by=video_viewed&from=$1 last; rewrite ^/most-popular/$ /videos_list.php?sort_by=video_viewed last; rewrite ^/categories/([0-9]+)/$ /categories_videos.php?from=$1 last; rewrite ^/categories/$ /categories_videos.php last; rewrite ^/categories/([^/]+)/([0-9]+)/$ /videos_list.php?category=$1&from=$2 last; rewrite ^/categories/([^/]+)/$ /videos_list.php?category=$1 last; rewrite ^/sites/([0-9]+)/$ /sponsors_videos.php?from=$1 last; rewrite ^/sites/$ /sponsors_videos.php last; rewrite ^/sites/([^/]+)/([0-9]+)/$ /videos_list.php?cs=$1&from=$2 last; rewrite ^/sites/([^/]+)/$ /videos_list.php?cs=$1 last; rewrite ^/models/([0-9]+)/$ /models_videos.php?from=$1 last; rewrite ^/models/$ /models_videos.php last; rewrite ^/models/([^/]+)/([0-9]+)/$ /videos_list.php?model=$1&from=$2 last; rewrite ^/models/([^/]+)/$ /videos_list.php?model=$1 last; rewrite ^/tags/$ /tags_videos.php last; rewrite ^/tags/([^/]+)/([0-9]+)/$ /videos_list.php?tag=$1&from=$2 last; rewrite ^/tags/([^/]+)/$ /videos_list.php?tag=$1 last; rewrite ^/channels/([0-9]+)/$ /channels.php?from=$1 last; rewrite ^/channels/$ /channels.php last; rewrite ^/channels/([^/]+)/([0-9]+)/$ /videos_list.php?dvd=$1&from=$2 last; rewrite ^/channels/([^/]+)/$ /videos_list.php?dvd=$1 last; rewrite ^/private/([0-9]+)/$ /videos_list.php?is_private=1&from=$1 last; rewrite ^/private/$ /videos_list.php?is_private=1 last; rewrite ^/premium/([0-9]+)/$ /videos_list.php?is_private=2&from=$1 last; rewrite ^/premium/$ /videos_list.php?is_private=2 last; rewrite ^/rss/$ /rss_videos.php last; rewrite ^/rss/tags/([^/]+)/$ /rss_videos.php?tag=$1 last; rewrite ^/rss/categories/([^/]+)/$ /rss_videos.php?category=$1 last; rewrite ^/rss/models/([^/]+)/$ /rss_videos.php?model=$1 last; rewrite ^/rss/sites/([^/]+)/$ /rss_videos.php?cs=$1 last; rewrite ^/rss/channels/([^/]+)/$ /rss_videos.php?dvd=$1 last; rewrite ^/rss/private/$ /rss_videos.php?is_private=1 last; rewrite ^/rss/premium/$ /rss_videos.php?is_private=2 last; rewrite ^/videos/([0-9]+)/([^/]+)/$ /view_video.php?id=$1&dir=$2 last; rewrite ^/videos/([^/]+)/$ /view_video.php?dir=$1 last; # albums --------------------------------------------------------------------------------------------------------------- rewrite ^/albums/([0-9]+)/$ /albums_list.php?from=$1 last; rewrite ^/albums/$ /albums_list.php last; rewrite ^/albums/top-rated/([0-9]+)/$ /albums_list.php?sort_by=rating&from=$1 last; rewrite ^/albums/top-rated/$ /albums_list.php?sort_by=rating last; rewrite ^/albums/most-popular/([0-9]+)/$ /albums_list.php?sort_by=album_viewed&from=$1 last; rewrite ^/albums/most-popular/$ /albums_list.php?sort_by=album_viewed last; rewrite ^/albums/categories/([0-9]+)/$ /categories_albums.php?from=$1 last; rewrite ^/albums/categories/$ /categories_albums.php last; rewrite ^/albums/categories/([^/]+)/([0-9]+)/$ /albums_list.php?category=$1&from=$2 last; rewrite ^/albums/categories/([^/]+)/$ /albums_list.php?category=$1 last; rewrite ^/albums/sites/([0-9]+)/$ /sponsors_albums.php?from=$1 last; rewrite ^/albums/sites/$ /sponsors_albums.php last; rewrite ^/albums/sites/([^/]+)/([0-9]+)/$ /albums_list.php?cs=$1&from=$2 last; rewrite ^/albums/sites/([^/]+)/$ /albums_list.php?cs=$1 last; rewrite ^/albums/models/([0-9]+)/$ /models_albums.php?from=$1 last; rewrite ^/albums/models/$ /models_albums.php last; rewrite ^/albums/models/([^/]+)/([0-9]+)/$ /albums_list.php?model=$1&from=$2 last; rewrite ^/albums/models/([^/]+)/$ /albums_list.php?model=$1 last; rewrite ^/albums/tags/$ /tags_albums.php last; rewrite ^/albums/tags/([^/]+)/([0-9]+)/$ /albums_list.php?tag=$1&from=$2 last; rewrite ^/albums/tags/([^/]+)/$ /albums_list.php?tag=$1 last; rewrite ^/albums/private/([0-9]+)/$ /albums_list.php?is_private=1&from=$1 last; rewrite ^/albums/private/$ /albums_list.php?is_private=1 last; rewrite ^/albums/premium/([0-9]+)/$ /albums_list.php?is_private=2&from=$1 last; rewrite ^/albums/premium/$ /albums_list.php?is_private=2 last; rewrite ^/albums/rss/$ /rss_albums.php last; rewrite ^/albums/rss/tags/([^/]+)/$ /rss_albums.php?tag=$1 last; rewrite ^/albums/rss/categories/([^/]+)/$ /rss_albums.php?category=$1 last; rewrite ^/albums/rss/models/([^/]+)/$ /rss_albums.php?model=$1 last; rewrite ^/albums/rss/sites/([^/]+)/$ /rss_albums.php?cs=$1 last; rewrite ^/albums/rss/private/$ /rss_albums.php?is_private=1 last; rewrite ^/albums/rss/premium/$ /rss_albums.php?is_private=2 last; rewrite ^/albums/([0-9]+)/([^/]+)/$ /view_album.php?id=$1&dir=$2 last; rewrite ^/albums/([^/]+)/$ /view_album.php?dir=$1 last; # playlists ------------------------------------------------------------------------------------------------------------ rewrite ^/playlists/([0-9]+)/([^/]+)/$ /view_playlist.php?id=$1&dir=$2 last; rewrite ^/playlists/([0-9]+)/$ /playlists_list.php?from=$1 last; rewrite ^/playlists/$ /playlists_list.php last; # community ------------------------------------------------------------------------------------------------------------ rewrite ^/members/$ /community.php last; rewrite ^/members/([0-9]+)/$ /member_profile_view.php?user_id=$1 last; rewrite ^/members/([0-9]+)/videos/$ /member_profile_view.php?user_id=$1&type=videos&ipp=12 last; rewrite ^/members/([0-9]+)/albums/$ /member_profile_view.php?user_id=$1&type=albums&ipp=12 last; rewrite ^/members/([0-9]+)/friends/$ /member_profile_view.php?user_id=$1&type=friends&ipp=20 last; rewrite ^/members/([0-9]+)/favorites/videos/$ /member_profile_view.php?user_id=$1&type=fav_videos&ipp=12 last; rewrite ^/members/([0-9]+)/favorites/albums/$ /member_profile_view.php?user_id=$1&type=fav_albums&ipp=12 last; rewrite ^/members/([0-9]+)/playlists/$ /member_profile_view.php?user_id=$1&type=playlists&ipp=12 last; rewrite ^/members/([0-9]+)/playlists/([0-9]+)/$ /member_profile_view.php?user_id=$1&type=fav_videos&ipp=12&playlist_id=$2 last; rewrite ^/members/([0-9]+)/channels/$ /member_profile_view.php?user_id=$1&type=channels&ipp=12 last; rewrite ^/my/$ /member_profile_my.php last; rewrite ^/my/videos/$ /member_profile_my.php?type=videos&ipp=12 last; rewrite ^/my/albums/$ /member_profile_my.php?type=albums&ipp=12 last; rewrite ^/my/friends/$ /member_profile_my.php?type=friends&ipp=20 last; rewrite ^/my/favorites/videos/$ /member_profile_my.php?type=fav_videos&fav_type=0&ipp=12 last; rewrite ^/my/favorites/videos-watch-later/$ /member_profile_my.php?type=fav_videos&fav_type=1&ipp=12 last; rewrite ^/my/favorites/albums/$ /member_profile_my.php?type=fav_albums&fav_type=0&ipp=12 last; rewrite ^/my/favorites/albums-see-later/$ /member_profile_my.php?type=fav_albums&fav_type=1&ipp=12 last; rewrite ^/my/playlists/$ /member_profile_my.php?type=playlists&ipp=12 last; rewrite ^/my/playlists/([0-9]+)/$ /member_profile_my.php?type=fav_videos&ipp=12&playlist_id=$1 last; rewrite ^/my/channels/$ /member_profile_my.php?type=channels&ipp=12 last; rewrite ^/my/channels/([0-9]+)/$ /member_profile_my.php?type=channel&ipp=12&dvd_id=$1 last; rewrite ^/my/subscriptions/$ /member_profile_my.php?type=subscriptions last; rewrite ^/my/purchases/$ /member_profile_my.php?type=purchases last; rewrite ^/my/messages/$ /member_profile_my.php?type=messages last; rewrite ^/my/messages/([0-9]+)/$ /member_profile_my.php?type=conversation&conversation_user_id=$1 last; rewrite ^/logout/$ /logout.php last; rewrite ^/email/$ /email_links.php last; rewrite ^/payments/$ /payment_links.php last; rewrite ^/login/$ /index.php?mode=async&function=get_block&block_id=logon_logon_form&global=true last; rewrite ^/login-required/$ /index.php?mode=async&function=get_block&block_id=logon_logon_form&global=true&error=only_for_members last; rewrite ^/signup/$ /index.php?mode=async&function=get_block&block_id=signup_signup_form_simple&global=true last; rewrite ^/upgrade/$ /index.php?mode=async&function=get_block&block_id=upgrade_upgrade_access&global=true last; rewrite ^/reset-password/$ /index.php?mode=async&function=get_block&block_id=signup_reset_password_form&global=true last; rewrite ^/resend-confirmation/$ /index.php?mode=async&function=get_block&block_id=signup_resend_confirmation_form&global=true last; rewrite ^/create-playlist/$ /index.php?mode=async&function=get_block&block_id=playlist_edit_edit_playlist_form&global=true last; rewrite ^/select-playlist/$ /index.php?mode=async&function=get_block&block_id=list_playlists_playlists_selector&global=true last; rewrite ^/edit-playlist/([0-9]+)/$ /index.php?mode=async&function=get_block&block_id=playlist_edit_edit_playlist_form&global=true&playlist_id=$1 last; rewrite ^/create-channel/$ /index.php?mode=async&function=get_block&block_id=dvd_edit_edit_channel_form&global=true last; rewrite ^/edit-channel/([0-9]+)/$ /index.php?mode=async&function=get_block&block_id=dvd_edit_edit_channel_form&global=true&dvd_id=$1 last; rewrite ^/edit-profile/$ /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_advanced&global=true&action=change_profile last; rewrite ^/change-password/$ /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_advanced&global=true&action=change_pass last; rewrite ^/change-email/$ /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_advanced&global=true&action=change_email last; rewrite ^/delete-profile/$ /index.php?mode=async&function=get_block&block_id=member_profile_delete_delete_profile_form&global=true last; rewrite ^/feedback/$ /index.php?mode=async&function=get_block&block_id=feedback_feedback_form&global=true last; rewrite ^/captcha/([^/]*)/$ /index.php?mode=async&function=show_security_code&captcha_id=$1 last; rewrite ^/upload-video/$ /member_profile_my.php?type=upload_video last; rewrite ^/upload-channel/([0-9]+)/$ /member_profile_my.php?type=upload_video&dvd_id=$1 last; rewrite ^/upload-video-preview/([^/]*)/$ /member_profile_my.php?mode=async&action=video_preview&file=$1 last; rewrite ^/edit-video/([0-9]+)/$ /member_profile_my.php?type=upload_video&video_id=$1 last; rewrite ^/upload-photos/$ /member_profile_my.php?type=upload_album last; rewrite ^/upload-photos-preview/([^/]*)/$ /member_profile_my.php?mode=async&action=album_preview&files=$1 last; rewrite ^/edit-photos/([0-9]+)/$ /member_profile_my.php?type=upload_album&album_id=$1 last; rewrite ^/categories-selector/$ /index.php?mode=async&function=get_block&block_id=list_categories_categories_selector&global=true last; rewrite ^/models-selector/$ /index.php?mode=async&function=get_block&block_id=list_models_models_selector&global=true last; rewrite ^/suggest/$ /search_suggestions.php last; # SYSTEM / DO NOT CHANGE ----------------------------------------------------------------------------------------------- rewrite ^/sitemap/$ /sitemap.php last; rewrite ^/sitemap\.xml$ /sitemap.php last; rewrite ^/embed/([0-9]+)/?$ /player/iframe_embed.php?video_id=$1 last; rewrite ^/related_videos_html/([0-9]+)/?$ /related_videos_html.php?video_id=$1 last; rewrite ^/get_file/([0-9]+)/([^/]*)/(.*)$ /get_file.php?sg_id=$1&hash=$2&file=$3 last; rewrite ^/get_image/([0-9]+)/([^/]*)/(.*)/$ /get_image.php?sg_id=$1&hash=$2&file=$3 last; # END SYSTEM ----------------------------------------------------------------------------------------------------------- location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; include snippets/fastcgi-php.conf; # depends your setup, fastcgi_pass may fastcgi_pass unix:/var/run/php/php7.x-fpm.sock while x is your php version fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # Disable .htaccess and other hidden files location ~ /\.(?!well-known).* { deny all; access_log off; log_not_found off; } } Quote Link to comment Share on other sites More sharing options...
Tech Support Posted January 7, 2023 Share Posted January 7, 2023 18 hours ago, Tanjiro said: KVS lacks of a lot question from members/costumers, some may be experts but a lot are newbies, fresh start don't know how to install, they need step by step guide, I have so much questions to ask, tried to find questions from members but I don't see no one, already read https://www.kernel-scripts.com/en/documentation/kvs_settings but not enough details for newbies KVS admin panel contains a lot of documentation itself, each field is described with hints, and many things are obvious. But you can always contact support if you don't understand some concepts. There are also a lot of articles here on different topics: https://forum.kernel-video-sharing.com/forum/13-educational-series/ Quote Link to comment Share on other sites More sharing options...
Mich Posted January 12, 2023 Share Posted January 12, 2023 Hi, this is not my last version template currently used but you could use it for improving your nginx configuration :) Here : https://github.com/MaximeMichaud/KVS-install/tree/main/conf/nginx Quote Link to comment Share on other sites More sharing options...
Yikmings Posted February 12, 2023 Share Posted February 12, 2023 Use nginx as proxy cache is much easy than use full nginx with rewrite rule. Quote Link to comment Share on other sites More sharing options...
Anay Posted March 3, 2023 Share Posted March 3, 2023 On 1/12/2023 at 11:15 AM, Mich said: Hi, this is not my last version template currently used but you could use it for improving your nginx configuration :) Here : https://github.com/MaximeMichaud/KVS-install/tree/main/conf/nginx This is actually a nice sample or starting point for nginx, was helpful. 1 Quote Link to comment Share on other sites More sharing options...
Evgen Posted Friday at 11:59 AM Share Posted Friday at 11:59 AM On 12.01.2023 at 08:45, Mich said: https://github.com/MaximeMichaud/KVS-install/tree/main/conf/nginx Hi, Mitch. Thanks for the config. It's really very useful. On 12.02.2023 at 12:36, Yikmings said: Using nginx as a proxy cache is much easier than using a full-fledged nginx with a rewrite rule. I am using a configuration with a proxy server. Nginx acts as a load balancer between two main servers. But I only use one server as a backup running server. to which traffic can always be directed in case of a failure or technical work on the main machine. A question for support, including you. I'm trying to figure out how to teach Nginx proxy server to work more efficiently with already loaded page content. At the moment, this is the case. - The video is partially uploaded. - Rewinds in an already loaded area with slowing down. Should Nginx be allowed to cache the full file during playback, and if so, how to do it? Do I need to increase the memory limit per Nginx worker? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted Friday at 12:33 PM Share Posted Friday at 12:33 PM 28 minutes ago, Evgen said: At the moment, this is the case. - The video is partially uploaded. - Rewinds in an already loaded area with slowing down. I would say this is not clear English translation... The video is partly downloaded, e.g. buffered? The 2nd part of the question is not clear at all, sounds like it is about fast-forward / skipping. 30 minutes ago, Evgen said: Should Nginx be allowed to cache the full file during playback, and if so, how to do it? I would say from my experience Nginx cannot decide that. The browser would first send Range 0- request requesting a load from zero byte. Then as soon as browser loads the MOOV metadata item, it may stop further loading depending on different factors from the browser end. Then when a skipping is requested browser will send another Range XXX- request requesting loading from XXX byte of the video. Then if video plays, browser will load as much as needed to continue smooth playing. If user pauses video, browser may stop further loading to avoid traffic usage. And so on. According to this pattern, Nginx doesn't have any vote here. Quote Link to comment Share on other sites More sharing options...
Evgen Posted Friday at 01:38 PM Share Posted Friday at 01:38 PM Okay. The main problem is that we have no control over the browser cache. If we can't buffer the video file completely, can we at least partially cache individual blocks of the proxied page on the proxy server. For example, so that all blocks with the list_videos type are not reloaded, but live in the user's cookies. Can I achieve this if the Nginx proxy uses balancing by the user's IP hash? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted Saturday at 04:40 AM Share Posted Saturday at 04:40 AM I'm not sure I understand what you are trying to ask... Quote Link to comment Share on other sites More sharing options...
hbarnetworks Posted Sunday at 08:22 PM Share Posted Sunday at 08:22 PM (edited) On 9/13/2024 at 3:38 PM, Evgen said: Okay. The main problem is that we have no control over the browser cache. If we can't buffer the video file completely, can we at least partially cache individual blocks of the proxied page on the proxy server. For example, so that all blocks with the list_videos type are not reloaded, but live in the user's cookies. Can I achieve this if the Nginx proxy uses balancing by the user's IP hash? Mate run the video files on a separate server not on your main servers. Whatever you are trying to do, don't cache video files in an NGINX buffer that is never going to work. Edited Sunday at 08:22 PM by hbarnetworks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.