Forum

Thread tagged as: Problem, Error

Port 80 redirection

Hi! I'm experiencing a problem with Perch, which started to happen after the installation of an SSL certificate.

Perch should be accessible through the URL https://example.com/cms. When I enter this URL, it gets redirected to https://example.com:80/cms/ which causes a security connection error (ERR_SSL_PROTOCOL_ERROR). If I remove the :80 part of the URL manually, I can access the login page normally. But, after I login, I get the :80 redirection again (https://example.com:80/cms/core/apps/content/) and the SSL error.

This wasn't happening before the installation of the SSL certificate, so I'm not sure if the error is related to a server configuration, or if I can change some settings in Perch (or make a clean install) in order to make it work again.

Here is the diagnostics report:

Perch: 2.8.34, PHP: 7.0.9, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Linux, litespeed
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /cms
PERCH_PATH: /home/ht149/www.just.com.pl/cms
PERCH_CORE: /home/ht149/www.just.com.pl/cms/core
PERCH_RESFILEPATH: /home/ht149/www.just.com.pl/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
HTTP_HOST: just.com.pl
DOCUMENT_ROOT: /home/ht149/www.just.com.pl
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Paul O'Rely

Paul O'Rely 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't believe Perch is involved in that port 80 redirect. It's just not something we do.

A good way to test would be to try going to an image with the correct URL and see if you still get the redirect. If you do, it's definitely server configuration and not Perch.

Drew, I tested different files and directories by their URLs, but this issue only happens when I access these URLs within Perch: /cms, /cms/core/apps/content/ (only after login), and /cms/core/apps/categories/

Drew McLellan

Drew McLellan 2638 points
Perch Support

Interesting. Do you have PERCH_SSL enabled? If so, turn it off. We don't set a port when we redirect, but it's possible that something else is, and then Perch is inheriting that setting.

I turned PERCH_SSL off. Unfortunately it makes no difference.

Drew McLellan

Drew McLellan 2638 points
Perch Support

How are you testing? Remember a browser can cache redirect responses.

Can you show me your extended diagnostics report?

I'm testing in different browsers, OSs, and networks, mostly ones that never accessed these URLs.

Here is the extended diagnostics report:

PERCH INFORMATION

Perch: 2.8.34
Production mode: Production (100)
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34)
DB driver: PDO
DB tables: perch2_categories (4), perch2_category_counts (0), perch2_category_sets (1), perch2_content_index (0), perch2_content_items (0), perch2_content_regions (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (0), perch2_pages (0), perch2_resource_log (0), perch2_resource_tags (0), perch2_resources (4), perch2_resources_to_tags (0), perch2_settings (17), perch2_user_passwords (1), perch2_user_privileges (26), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (2)
Users: 2
PHPMailer: 5.2.21
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
    );
Editor plug-ins: markitup
H1: 264abfb04eac5afde33d07103a56d940
L1: 1a3222356a392ded5679255d4852117c
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: https://just.com.pl
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.34: done
latest_version: 2.8.15
on_sale_version: 2.8.34
headerScheme: light
content_hideNonEditableRegions: 1
dashboard: 0
hide_pwd_reset: 0
content_frontend_edit: 0
logoPath: /cms/resources/just-logo-cms-2.png
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: 149_just2
PERCH_DB_SERVER: 
PERCH_DB_DATABASE: 149_just2
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/Warsaw
PERCH_EMAIL_FROM: 
PERCH_EMAIL_FROM_NAME: Paul ORely
PERCH_LOGINPATH: /cms
PERCH_PATH: 
PERCH_CORE: 
PERCH_RESFILEPATH: 
PERCH_RESPATH: /cms/resources
PERCH_HTML5: 1
PERCH_IMAGE_LIB: imagick
PERCH_SCHEDULE_SECRET:
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: 
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 7.0.9
Zend: 3.0.0
OS: Linux
SAPI: litespeed
Safe mode: not detected
MySQL client: mysqlnd  - - $Id: $
MySQL server: 
Free disk space: 2.96 TB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, litespeed, bcmath, gd, imagick, intl, json, exif, mcrypt, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pgsql, Phar, posix, soap, sockets, sysvmsg, sysvsem, sysvshm, dom, xmlreader, xmlrpc, xmlwriter, xsl, zip, ionCube Loader, Zend OPcache
GD: Yes
ImageMagick: Yes
PHP max upload size: 128M
PHP max form post size: 128M
PHP memory limit: 128M
Total max uploadable file size: 128M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PATH: /usr/local/bin:/usr/bin:/bin
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,pl;q=0.6
HTTP_COOKIE: __utma=145083567.81762237.1472815966.1473065149.1473146366.3; __utmz=145083567.1472815966.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cookiepolicyjust=true; _ga=GA1.3.81762237.1472815966; cmsa=1; PHPSESSID=hlvs8oga9357h8c98c3kdfohp7
HTTP_HOST: just.com.pl
HTTP_REFERER: https://just.com.pl/cms/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
HTTP_X_FORWARDED_FOR: 217.168.138.71, 127.0.0.1
HTTP_X_REAL_IP: 127.0.0.1
HTTP_X_FORWARDED_PROTO: https
HTTP_X_FORWARDED_HOST: just.com.pl
HTTP_X_FORWARDED_SERVER: just.com.pl
HTTP_X_FORWARDED_PORT: 80
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTPS: on
UNIQUE_ID:
proto: https
SERVER_SOFTWARE: Apache/2.4.6 ()
SERVER_NAME: just.com.pl
SERVER_ADDR: 
SERVER_PORT: 80
REMOTE_ADDR: 
DOCUMENT_ROOT: 
REQUEST_SCHEME: https
CONTEXT_DOCUMENT_ROOT:
SERVER_ADMIN: root@localhost
SCRIPT_FILENAME:
REMOTE_PORT: 58134
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /cms/core/settings/diagnostics/?extended
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
PHP_SELF: /cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1487148772.594
REQUEST_TIME: 1487148772
Drew McLellan

Drew McLellan 2638 points
Perch Support

So when I go here, there's no problem:

https://just.com.pl/cms/

The :80 redirect happens when I go here:

https://just.com.pl/cms

So it looks like it's something to do with how your server is handling the redirect to a default document.

At this point it would probably be best to ask your server administrator to get their opinion.

I'll do it. Thanks for the help!