Skip to content

Backend is not working on ports other than 80 and 443 #6865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mattcoz opened this issue Oct 4, 2016 · 15 comments
Closed

Backend is not working on ports other than 80 and 443 #6865

mattcoz opened this issue Oct 4, 2016 · 15 comments

Comments

@mattcoz
Copy link

mattcoz commented Oct 4, 2016

Previous issue was closed, again, but it is NOT fixed in the latest 2.1.1. #6735

Preconditions: Magento installed on ports other than 80 and 443
Steps to reproduce: Try to access backend
Actual result: 404 not found
Expected result: Backend loads

@shiftedreality shiftedreality changed the title Backend STILL redirects to 404 Backend is not working on ports other than 80 and 443 Oct 4, 2016
@shiftedreality
Copy link
Member

Hi @mattcoz

I was unable to reproduce this issue on 2.1.1 using :8080 as port.

screenshot at oct 04 11-42-06

And :81

screenshot at oct 04 11-46-19

Could you please provide more details?

@ctadlock
Copy link

ctadlock commented Oct 14, 2016

I am having this same issue. I believe the issue is caused when the secure and insecure are using different ports.

Environment

MacOS 10.12, Apache 2.4, PHP7

Magento Install Script

magento setup:install -vvv --base-url="http://store-dev.test.net:30010/" --use-secure=1 --base-url-secure="https://store-dev.test.net:30000" --use-secure-admin=1 --backend-frontname="the_admin" 

Apache Conf

Listen 30000
<VirtualHost *:30000>
    DocumentRoot /Users/dev/STORE_HOME/src/web/pub

    SSLEngine on
    SSLCertificateFile "/usr/local/etc/apache2/2.4/server.crt"
    SSLCertificateKeyFile "/usr/local/etc/apache2/2.4/server.key"

    ErrorLog /usr/local/var/log/apache2/store-dev_error.log
    CustomLog /usr/local/var/log/apache2/store-dev.log combined

    RewriteOptions Inherit

    <Directory /Users/dev/STORE_HOME/src/web/pub>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Listen 30010
<VirtualHost *:30010>
    DocumentRoot /Users/dev/STORE_HOME/src/web/pub

    ErrorLog /usr/local/var/log/apache2/store-dev_error.log
    CustomLog /usr/local/var/log/apache2/store-dev.log combined

    RewriteOptions Inherit

    <Directory /Users/dev/STORE_HOME/src/web/pub>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

@ctadlock
Copy link

Im not sure what the correct fix for this is. But in the code below if you replace Store::XML_PATH_UNSECURE_BASE_URL with Store::XML_PATH_SECURE_BASE_URL, it all works great.

https://github.com/magento/magento2/blob/develop/app/code/Magento/Backend/App/Area/FrontNameResolver.php#L99

@ctadlock
Copy link

@mattcoz Any updates on this?

@mattcoz
Copy link
Author

mattcoz commented Dec 23, 2016

Nope, they apparently have no interest in fixing it. I'm no longer using alternate ports.

@magento-engcom-team magento-engcom-team added bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update Component: Setup labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

Hi @mattcoz pleaser let us know if the issue still relevant.

@magento-engcom-team magento-engcom-team self-assigned this Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@mattcoz we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Oct 5, 2017
@simon-letch
Copy link

I'm currently running a local instance of Magento on ports 81 (http) and 443 (https) and am encountering this issue. Admin 404s despite configuration being correct with regards to rewrites/permissions etc.

@ctadlock, your fix works for me too. Changing XML_PATH_UNSECURE_BASE_URL to XML_PATH_SECURE_BASE_URL in isHostBackend() fixes it.

It looks like isHostBackend() should check XML_PATH_SECURE_IN_ADMINHTML and use the secure/unsecure base url accordingly.

@Davej817
Copy link

This still isnt fixed in 2.3.2. Took me all day to find this post and fixed the problem by using the secure https address in both base urls in the database.
Started by using 8080 as the unsecure which worked until going into admin and getting a 404 error.
fixed by;
web/unsecure/base_url | https://mydomain:8443/
web/secure/base_url | https://mydomain:8443
I hope this has no knock on effects.

@tschirmer
Copy link

We're using docker and we get this as well.

@JacobBrownAustin
Copy link
Contributor

I'm seeing this issue as well on Magento 2.2.11 .
Thanks for the workaround @simon-letch and @tschirmer !

@JacobBrownAustin
Copy link
Contributor

Also experiencing this on 2.3.4 (current latest release).

@Megarushing
Copy link

Megarushing commented Feb 24, 2020

I was experiencing this before using bitnami magento2 docker image, but now I updated the image to 2.3.4 and this issue doesnt seem to be happening anymore, disabled the workaround

@dverkade
Copy link
Member

The backoffice loads on port 8888, see screenshot.

image

@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 21, 2020
@stale
Copy link

stale bot commented Jan 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale issue label Jan 5, 2021
@stale stale bot closed this as completed Jan 19, 2021
mmansoor-magento added a commit that referenced this issue Aug 10, 2021
[cia] MC-41647: SKU Search very slow on Admin Panel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests