Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

wordpress / laravel | http to https

1) install docker and compose

2) docker-compose.yml

version: '3.3'


services:

   db:

     image: mysql:5.7

     volumes:

       - db_data:/var/lib/mysql

     restart: always

     environment:

       MYSQL_ROOT_PASSWORD: somecloudfirst

       MYSQL_DATABASE: cloudfirst

       MYSQL_USER: cloudfirst

       MYSQL_PASSWORD: cloudfirst


   cloudfirst:

     depends_on:

       - db

     image: wordpress:latest

     ports:

       - "80:80"

     restart: always

     environment:

       WORDPRESS_DB_HOST: db:3306

       WORDPRESS_DB_USER: cloudfirst

       WORDPRESS_DB_PASSWORD: cloudfirst

       WORDPRESS_DB_NAME: cloudfirst

volumes:

    db_data: {}

3) docker compose up -d

4) install nginx OR create classic loadbalancer and send traffic to port 80.

5) add https listner and get the crt.

6) now you will see the images are not loading correctly when type https://domain


fix:  

2) go to https://mycloudservicepartner.com/wp-admin/options-general.php

wordpress address and site address change to https://domain



================

Laravel

1) install nginx and create classic loadbalancer and send traffic to port 80.

2) add https listner and get the crt.

3) enable auto redirect.

server {

    listen 80 default_server;

    listen [::]:80 default_server;

    root /var/www/html/public;

    index index.php index.html;

    server_name abc.org;

# Added by hasaranga prasad

    if ($http_x_forwarded_proto = 'http'){

    return 301 https://$host$request_uri;

    }

#############################

    location / {

        try_files $uri $uri/ /index.php?$query_string;

    }

    # pass the PHP scripts to FastCGI server

    #

    location ~ \.php$ {

        include snippets/fastcgi-php.conf;

        fastcgi_pass unix:/run/php/php7.4-fpm.sock;

    }

}

3) now you will see the images are not loading correctly when type https://domain

4) Modify Laravel (https://stackoverflow.com/questions/44409807/laravel-https-routes)
/var/www/html/.env
----------------------------------------

#APP_URL=http://localhost

APP_URL=https://abc.org

FORCE_HTTPS=true

------------------------------------------


/var/www/html/app/Providers/AppServiceProvider.php
-------------------

use Illuminate\Support\Facades\URL;

######################


class AppServiceProvider extends ServiceProvider

{

    /**

     * Register any application services.

     *

     * @return void

     */

    public function register()

    {

        //

    }


    /**

     * Bootstrap any application services.

     *

     * @return void

     */

    public function boot()

     {

       \Illuminate\Support\Facades\Schema::defaultStringLength(191);

######Added by hasaranga prasad##############

          if(env('FORCE_HTTPS',false)) { // Default value should be false for local server

        URL::forceScheme('https');

    }


------------------- 

===========================
subdomain DNS

www.abc | CNAME | <> | abc.mydomain.com
abc 
| CNAME | <> | ELB_URL

1 comment:

  1. LuckyClub Casino Site – Latest Promotions for UK players
    Lucky Club is a luckyclub.live UK licensed and regulated online casino. The site is licensed and regulated by the UK Gambling Commission. You can use the terms and conditions to

    ReplyDelete