Score:0

How to reverse proxy assets from another unsecured website?

bq flag

I have this situation. Current VM where this nginx config is stored has a valid ssl certificate. Inside this VM is the main application app1 served in port 80. On another port 1234 another service is served app2 in a docker container. I managed to reverse proxy app2 like this

       location /app2/ {
           proxy_pass          http://127.0.0.1:1234/;

           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           proxy_read_timeout 600s;

           proxy_redirect    http://127.0.0.1:3888/ http://127.0.0.1:8080/vnc/;
           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-Protocol $scheme;
       }

app2 can be accessed by https://mywebsite.com/app2

Now I have a Laravel app in another VM app3 (not in a docker container). I did the same procedure. When I go to https://websited.com/app3 it only loads the html part but not javascript and css. The error on mozilla console shows as

Blocked loading mixed active content “http://mywebsite.com/css/style.css”

As I understand it should look inside the resources of the VM that app3 is stored. How do I make the nginx to load app3 resources like js and css?

us flag
You mention `mywebsite.com/app2` and `websited/app3`. Can you clarify what are the exact sites here? Also, if you could provide the output of `nginx -T` in the question, that would be helpful in seeing the full picture.
Score:1
us flag

You need to set the root URL in your Laravel application, so that Laravel generates the correct URLs for the resources it refers to.

https://stackoverflow.com/questions/35304448/laravel-change-base-url has information how to do it.

llesh avatar
bq flag
Thanks for the suggestion. Unfortunately it still search within current VM for the styling files and javascript.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.