Jump to content

sample nginx.conf file available?


rob70
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;
        }
}

 

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...