SSL_ERROR_INTERNAL_ERROR_ALERT when accessing api platform - api-platform.com

API Platform V.2.6.5 with docker-compose downloaded from the official website
Problem : I can't send requests to the API, or access the UI from my browser. I'm facing a SSL_ERROR_INTERNAL_ERROR_ALERT
This is a brand new project I did not edit any file.
Note that i'm using Docker Toolbox for Windows and my docker is running on https://192.168.100.0, not localhost.
I tried on anoter PC where the domain for docker is localhost and it works.
However, the containers start well. I can even create entities and update my database.
Do you have an idea why this error is happening and how to resolve this ?

Most likely it's a caddy thing not having a valid SSL certificate, check at
docker-compose logs caddy
Here is an issue at caddy community: https://caddy.community/t/local-ip-address-creates-ssl-error/11314

Related

Deploy Outlook Add-in on an AWS EC2 instance

We are trying to host a custom Outlook Add-in on an AWS EC2 instance. We are using a windows server in EC2 to host this. Currently we are using webpack dev server to host it locally and everything is working fine. Now we need to deploy and have this app run as a service in the Windows Server.
We have tried to deploy the build on an IIS server. But we were not able to proceed after logging in to the application. We are getting the error as a Bad request. We also have tried to deploy it on Apache server using XAMP. But the results were the same. It is getting deployed in the webservers, however when we are hitting the backend application it seems to be erroring out.
The error we are getting is Error: redirect_uri_mismatch, when we try to authenticate and redirect to the authenticated home page of the application.
When we deploy the same using webpack-dev-server in the instance, It is working as indented.
We are facing issue to identify the proper reason for this error and unable to deploy the service in EC2.
EDIT
Screenshoot-1
Screenshot-2

Fetch data from gatServerProps of NextJs app when another api server is also running in localhost

According NextJs Documentations:
You should not use fetch() to call an API route in getServerSideProps. Instead, directly import the logic used inside your API route. You may need to slightly refactor your code for this approach.
Fetching from an external API is fine!
So we cannot use NextJs built-in APIs in getStaticProps or getServerSidePropsbut when I'm going to use another API service that is based on Laravel Framework as the back server and fetch it by Axios on the getServerSideProps function, I get Error: connect ECONNREFUSED 127.0.0.1:8080 error.
It should also be noted that everything is fine if the API server is addressed out of our development machine. In Other words, It will face when it's the development environment and both Laravel backend server and NextJs front-end server locate at localhost.
Could you help me out finding a solution for this problem?
When using localhost or 127.0.0.1 inside a docker container, that points to that docker container only, not the host computer.
There are two pretty easy solutions.
Create a docker network, add both containers to that, and use container name instead of ip (https://www.tutorialworks.com/container-networking/)
Use host networking for this container: https://docs.docker.com/network/host/
Edit: Added a link for a tutorial on how to create and use docker networks
So, as #tperamaki's answer already mentions: "When using localhost or 127.0.0.1 inside a docker container, that points to that docker container only, not the host computer."
You can use the ip of your machine in your local network. By example, 196.168.0.10:8080 instead 127.0.0.1:8080.
But you also can connect to the special DNS name host.docker.internal which resolves to the internal IP address used by the host.
In your case just add the port where the othe container is listening:
http://host.docker.internal:8080
In this section of the documentation Networking features in Docker Desktop for Mac, they explain how to connect from a container to a service on the host. Note that a mac is mentioned there, but I tried it on a linux distro and it also works (also in this other answer it is mentioned that it works for windows).

Shopify CLI - How to start a local server without ngrok?

My organization blocks ngrok, so every time I run the Shopify serve command, it fails with a connection error.
So is there any way to just start the Shopify local server? that way I can use cloudfared to tunnel the local server to a subdomain.
When I search on google I found no answer to this question.
I had success running the server without the ngrok.
Here are my steps:
Prepare a cloud server, install Nginx.
config domain settings, and forward the request to your local port.
If you are using a router, only router has a public IP, so you need to forward the request to your pc. You could config it in the router.
then you need to update .env file, update host value
Go partner.shopify.com, app settings. put your URL to the whitelist.
use npm run dev to start your project.
I also set HTTPS in nginx. Due to ngrok server is far away from my location. so after using this way. the starting time is much faster.
Start the server by
npm run dev
instead of,
shopify app serve

How to deploy a React app with Strapi (from localhost to an external server e.g. AWS)?

I am developing a website, where posts are published through Strapi. My website is a React app. For Hosting, I use (Amazon's) AWS.
My question is simple. I want to deploy my localhost application, and make visible to the WWW. I was searching for tutorials but could not find any that helps me in this.
Thank you!
ok deploy process is simple:
You get a server like digital ocean.
you push your projecto into a github repo.
Configure mongo, node, ngnix and clone your project into www folder
enter in your folder app and make npm install --production
latter insall PM2 and make it run
this is a little explaination the real explanaition you can see here:
how to deploy strapi app on ubuntu server
The www you can modified adding Cname at your server and vinculing your dns with you domain in you name domain proveedor

docker: what is the similar url in docker as compared to XAMMP/MAMP

I am using docker for the codeigniter project development. Initially, when I used MAMP or XAMMP, the login page was localhost/xyz/admin/login as the server used to run on localhost (php server). But, the docker server is running on localhost:8000 and I am trying to open localhost:8000/xyz/admin/login but it shows an error that page you requested not found. Does someone know the answer to this problem? I have also tried localhost:8000/myapp_1/xyz/admin/login , localhost:8000/myapp_1/admin/login etc. but nothing seems to work.
Thanks in advance!

Resources