Vagrant HTTP vs HTTPS

I am still trying to get vagrant working for my development team and I ran into another issue that seems like it should be a breeze to solve but after hours on google I still cant make it work

The only port opened up on Vagrant is 8080 meaning no SSL The problem is that while Sugar works fine on port 80 it requests all its fonts and graphics on HTTPS.


This is a normal Sugar Call, note it goes to HTTP as it should


While this is a font call attempting to be called on HTTPS

I cant find a reason why it would be on HTTPS, my config.php is fine.  Nothing in the .htaccess file would do it.

So I thought I would just enable SSL.  Pretty easy, done it a thousand times.   I create the certificate and create the virtual host and nothing.  Can not connect.  I have a feeling this is a vagrant thing but I cant find anything that matches.

Parents
  • Hi  

    Are you can try with proxy server ? Like nginx.

    Y share with you my config.

    nginx/nginx.conf

    http {
        ...
        include /etc/nginx/conf.d/*.conf;
    }

    ./nginx/conf.d/<name_your_local_instance>.conf

    server {
                    listen   80;
                    server_name sugarent1100ex.loc;
                    location / {
                            proxy_pass http://localhost:8080/sugar/sugarent1100ex.loc/;
                            include /etc/nginx/proxy_params;
                    }
            }
    

    ./nginx/proxy_params

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    
    client_max_body_size 100M;
    client_body_buffer_size 1m;
    proxy_intercept_errors on;
    proxy_buffering on;
    proxy_buffer_size 128k;
    proxy_buffers 256 16k;
    proxy_busy_buffers_size 256k;
    proxy_temp_file_write_size 256k;
    proxy_max_temp_file_size 0;
    proxy_read_timeout 1200s;
    proxy_connect_timeout 1200s;
    
    
    #client_body_buffer_size 16k;
    #client_header_buffer_size 1k;
    #client_max_body_size 25m;
    #large_client_header_buffers 4 8k;
    

    The .htaccess looks like this

    # BEGIN SUGARCRM RESTRICTIONS
    # Fix mimetype for logo.svg (SP-1395)
    AddType     image/svg+xml     .svg
    AddType     application/json  .json
    AddType     application/javascript  .js
    
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
        RewriteBase /sugar/sugarent1000ex.loc/
        RewriteRule (?i)\.git - [F]
        RewriteRule (?i)\.log$ - [F]
        RewriteRule (?i)^bin/ - [F]
        RewriteRule (?i)^cache/diagnostic/ - [F]
        RewriteRule (?i)^composer\.(json|lock)$ - [F]
    ...

    You can add the name instance into hosts file.

    Into windows you can follow the tutorial here

    I hope to be helpful

    Take care.

Reply
  • Hi  

    Are you can try with proxy server ? Like nginx.

    Y share with you my config.

    nginx/nginx.conf

    http {
        ...
        include /etc/nginx/conf.d/*.conf;
    }

    ./nginx/conf.d/<name_your_local_instance>.conf

    server {
                    listen   80;
                    server_name sugarent1100ex.loc;
                    location / {
                            proxy_pass http://localhost:8080/sugar/sugarent1100ex.loc/;
                            include /etc/nginx/proxy_params;
                    }
            }
    

    ./nginx/proxy_params

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    
    client_max_body_size 100M;
    client_body_buffer_size 1m;
    proxy_intercept_errors on;
    proxy_buffering on;
    proxy_buffer_size 128k;
    proxy_buffers 256 16k;
    proxy_busy_buffers_size 256k;
    proxy_temp_file_write_size 256k;
    proxy_max_temp_file_size 0;
    proxy_read_timeout 1200s;
    proxy_connect_timeout 1200s;
    
    
    #client_body_buffer_size 16k;
    #client_header_buffer_size 1k;
    #client_max_body_size 25m;
    #large_client_header_buffers 4 8k;
    

    The .htaccess looks like this

    # BEGIN SUGARCRM RESTRICTIONS
    # Fix mimetype for logo.svg (SP-1395)
    AddType     image/svg+xml     .svg
    AddType     application/json  .json
    AddType     application/javascript  .js
    
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
        RewriteBase /sugar/sugarent1000ex.loc/
        RewriteRule (?i)\.git - [F]
        RewriteRule (?i)\.log$ - [F]
        RewriteRule (?i)^bin/ - [F]
        RewriteRule (?i)^cache/diagnostic/ - [F]
        RewriteRule (?i)^composer\.(json|lock)$ - [F]
    ...

    You can add the name instance into hosts file.

    Into windows you can follow the tutorial here

    I hope to be helpful

    Take care.

Children
No Data