I am having an issue accessing my site using https. Here is the layout
domain.com -> Has SSL certificate -> works perfectly
subdomain.domain.com -> Has SSL certificate covering the subdomain -> ISSUES
– This subdomain has an A DNS record looking at a Linode Server IP address hosting my Laravel
Accessing http://subdomain.domain.com/
works but shows no padlock
Accessing https://subdomain.domain.com/
throws cannot be reached
with Laravel giving the Invalid request (Unsupported SSL request)
error
Here is my ENV
APP_ENV=production
APP_DEBUG=true
APP_URL=https://subdomain.domain.com
SERVER_PORT=443
SERVER_HOST=<linodeIPAddressHere>
There is nothing in the boot()
AppServiceProvider.php and I have tried many solutions. My Linode Firewall is allowing port 443 inbound and outbound, the SSL certificate is 100% installed using SSL checker websites. I’m stuck here. I’m happy to troubleshoot anything as I’ll be working on this until I can find a fix.
2
Answers
Here are a few suggestions to help you troubleshoot and resolve the issue:
Verify SSL Certificate Installation: Double-check the SSL certificate installation for the subdomain subdomain.domain.com. Ensure that the certificate is installed correctly on the server hosting the Laravel application. You can use online SSL certificate checkers to verify the installation and check for any potential issues.
Check Virtual Host Configuration: Ensure that your web server’s virtual host configuration for the subdomain is correctly set up to handle SSL requests. In the configuration file, make sure that the SSL certificate and key paths are specified correctly.
Confirm HTTPS Listener: Verify that your web server (e.g., Apache or Nginx) is configured to listen on port 443 for HTTPS requests. Check the server configuration to ensure that the SSL module is enabled and that the appropriate virtual host configuration is present.
Mixed Content Issue: If the SSL certificate is installed correctly and the server is properly configured, another common issue that can cause the padlock to not appear is mixed content. This occurs when your web page includes resources (such as images, scripts, or stylesheets) loaded over HTTP instead of HTTPS. Make sure that all the resources loaded on your page are using HTTPS URLs to avoid this issue.
Laravel Configuration: Check your Laravel application’s configuration to ensure that it is correctly set up for HTTPS. In the config/app.php file, verify that the url option is set to https://subdomain.domain.com. Additionally, check any other configuration files where you might have hard-coded HTTP URLs and update them to use HTTPS.
Firewall or Load Balancer Settings: If you are using a firewall or a load balancer, make sure that it is correctly configured to forward HTTPS traffic to the correct server hosting your Laravel application. Check the settings to ensure that port 443 is allowed and forwarded correctly.
Debugging Tools: Utilize debugging tools and logs to gather more information about the issue. Check the web server’s error logs, Laravel’s logs (storage/logs/laravel.log), and any other relevant logs to see if they provide any clues about the specific error or misconfiguration.
By going through these steps, you should be able to identify and resolve the issue preventing you from accessing your subdomain https://subdomain.domain.com securely.
Maybe you need to edit .htaccess file in public folder of your domain … If on APACHE -> Something like this: