Notice: Constant EZSQL_VERSION already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/db.php on line 43

Notice: Constant object already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/db.php on line 48

Notice: Constant OBJECT_K already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/db.php on line 53

Notice: Constant ARRAY_A already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/db.php on line 58

Notice: Constant ARRAY_N already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/db.php on line 63

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 214

Notice: Constant EZSQL_VERSION already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 43

Notice: Constant object already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 48

Notice: Constant OBJECT_K already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 53

Notice: Constant ARRAY_A already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 58

Notice: Constant ARRAY_N already defined in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-module.php on line 63

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/private_1/data/www/linuxguru.ru/wp-includes/wp-db.php on line 1633

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/db-cache-reloaded-fix/db-cache-reloaded.php on line 91

Notice: add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 4039

Notice: add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 4039

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/smilies-themer/smilies-themer.php on line 80

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/smilies-themer/smilies-themer.php on line 213

Notice: get_settings is deprecated since version 2.1.0! Use get_option() instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3844

Notice: get_settings is deprecated since version 2.1.0! Use get_option() instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3844

Notice: add_custom_background is deprecated since version 3.4.0! Use add_theme_support( 'custom-background', $args ) instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3844

Notice: The called constructor method for WP_Widget in Suffusion_Search is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Meta is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Follow_Twitter is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Category_Posts is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Featured_Posts is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Google_Translator is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Subscription is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Flickr is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Query_Users is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: The called constructor method for WP_Widget in Suffusion_Child_Pages is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3907

Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 4039

Notice: get_settings is deprecated since version 2.1.0! Use get_option() instead. in /var/www/private_1/data/www/linuxguru.ru/wp-includes/functions.php on line 3844
Правильный редирект с http на https при помощи nginx
Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971

Notice: Array to string conversion in /var/www/private_1/data/www/linuxguru.ru/wp-includes/formatting.php on line 971
 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

nginx redirect 301 ssl

Давайте предположим что мы купили ssl сертификат для интерет магазина и теперь пришло время правильно настроить сайт, а именно  редирект с http на https при помощи nginx, веедь мы хостим что бы посетителей перекидовало на защищенное соединение. Панелька хостинга у нас isp manager, как установить ssl сертификат в isp я уже писал тут, казалось бы нет не чего проще простого — нужно пойти во вкладку «Редиректы» и добавть запись такого вида:

Путь                        Код                            Url

/ 301 — перенесен на новый адрес https://site.com/

тут и начинаются приключения, вы попадете в вечный редирект т.к оно срабатывает на любой запрос в корень / будь это http или https  если у домена включен ssl который работает через nginx.

Аналогично не получится сделать корректный редирект при помощи .htaccess по сути тем же апачем.

Рещение вопроса простое, нужно направлять пользователя на защищенное соединенте сразу nginx-ом:

в секцию сервер

В результате имеем правильный редирект на nginx

301 (Permanent Redirect) – ресурс навсегда перемещен на новый URI.

По желанию можно там же настроить с www на без www.

 

  5 комментариев в “Правильный редирект с http на https при помощи nginx”


  1. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

    «правельный» редирект — это прекрасно! (:

     

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

    Just awesome

     

  3. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

    very helpful post

     

  4. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

    Спасибо, работает на ура.
    Скажите, плиз, а как этой конструкции добавить 301й редирект с www на без www

     

  5. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68

    request the best hair treatment in Abu Dhabi to increase your attractivness. Sales!

     

 Оставить комментарий

(обязательно)

(обязательно)

   
Copyright © 2012. Linuxguru.ru

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'smilies_package' does not have a method 'credit_author' in /var/www/private_1/data/www/linuxguru.ru/wp-includes/class-wp-hook.php on line 298

Notice: Undefined index: rel in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 113

Notice: Undefined index: loop in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 121

Notice: Undefined index: loop in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 121

Notice: Undefined index: scrolling in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 129

Notice: Undefined index: scrolling in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 129

Notice: Undefined index: esc_key in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 130

Notice: Undefined index: esc_key in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 130

Notice: Undefined index: arrow_key in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 131

Notice: Undefined index: arrow_key in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 131

Notice: Undefined index: top in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 132

Notice: Undefined index: top in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 132

Notice: Undefined index: right in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 133

Notice: Undefined index: right in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 133

Notice: Undefined index: bottom in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 134

Notice: Undefined index: bottom in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 134

Notice: Undefined index: left in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 135

Notice: Undefined index: left in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 135

Notice: Undefined index: fixed in /var/www/private_1/data/www/linuxguru.ru/wp-content/plugins/lightbox-plus/classes/actions.class.php on line 136